etcd: sample conf file cluster node add

added support to install etcd-new.conf.sample in etc/etcd
path, which can be used for starting etcd cluster or node add.

This is only reference config file, which can be used for application
or users to easily customise node specific configuration.

Change-Id: I37072eb4ded0dfac88045e84ba816ea82438b355
Signed-off-by: ojayanth <ojayanth@in.ibm.com>
diff --git a/meta-phosphor/recipes-extended/etcd/etcd/etcd-new.conf.sample b/meta-phosphor/recipes-extended/etcd/etcd/etcd-new.conf.sample
new file mode 100644
index 0000000..1b005ba
--- /dev/null
+++ b/meta-phosphor/recipes-extended/etcd/etcd/etcd-new.conf.sample
@@ -0,0 +1,43 @@
+# This is the sample configuration file to start new etcd
+# single node cluster.
+
+# Initial cluster state ('new' or 'existing').
+ETCD_INITIAL_CLUSTER_STATE='new'
+
+# Path to the data directory.
+ETCD_DATA_DIR='/var/lib/etcd'
+
+# Time (in milliseconds) of a heartbeat interval.
+ETCD_HEARTBEAT_INTERVAL=100
+
+# Time (in milliseconds) for an election to timeout.
+ETCD_ELECTION_TIMEOUT=1000
+
+# List of comma separated URLs to listen on for peer traffic.
+ETCD_LISTEN_PEER_URLS=http://localhost:2380
+
+# List of comma separated URLs to listen on for client traffic.
+ETCD_LISTEN_CLIENT_URLS=http://localhost:2379
+
+# List of this member's peer URLs to advertise to the rest of the cluster.
+# The URLs needed to be a comma-separated list.
+ETCD_INITIAL_ADVERTISE_PEER_URLS=http://localhost:2380
+
+# List of this member's client URLs to advertise to the public.
+# The URLs needed to be a comma-separated list.
+ETCD_ADVERTISE_CLIENT_URLS=http://localhost:2379
+
+# Enable info-level logging for etcd.
+ETCD_LOG_LEVEL='info'
+
+# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
+ETCD_LOG_OUTPUTS='default'
+
+# etcd is not officially supported on arm64
+ETCD_UNSUPPORTED_ARCH='arm'
+
+# Human-readable name for this member.
+# ETCD_NAME='default'
+
+# Initial cluster configuration for bootstrapping.
+# ETCD_INITIAL_CLUSTER='default=http://localhost:2380'
diff --git a/meta-phosphor/recipes-extended/etcd/etcd_%.bbappend b/meta-phosphor/recipes-extended/etcd/etcd_%.bbappend
new file mode 100644
index 0000000..9c91365
--- /dev/null
+++ b/meta-phosphor/recipes-extended/etcd/etcd_%.bbappend
@@ -0,0 +1,8 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+SRC_URI:append = " file://etcd-new.conf.sample"
+
+do_install:append() {
+    install -m 0644 ${WORKDIR}/etcd-new.conf.sample -D -t ${D}${sysconfdir}
+}
+
+FILES:${PN}:append = " ${sysconfdir}/etcd-new.conf.sample"