#!/bin/sh

. /etc/sysconfig/heat-params

myip=$(ip addr show eth0 |
awk '$1 == "inet" {print $2}' | cut -f1 -d/)

cat > /etc/etcd/etcd.conf <<EOF
# [member]
ETCD_NAME="$myip"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001"
ETCD_LISTEN_PEER_URLS="http://$myip:7001"

[cluster]
ETCD_ADVERTISE_CLIENT_URLS="http://$myip:4001"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://$myip:7001"
ETCD_DISCOVERY="$ETCD_DISCOVERY_URL"
EOF

#!/bin/sh

. /etc/sysconfig/heat-params

myip=$(ip addr show eth0 |
awk '$1 == "inet" {print $2}' | cut -f1 -d/)

cat > /etc/etcd/etcd.conf <<EOF
ETCD_NAME="$myip"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001"
ETCD_LISTEN_PEER_URLS="http://$myip:7001"

ETCD_ADVERTISE_CLIENT_URLS="http://$myip:4001"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://$myip:7001"
ETCD_DISCOVERY="$ETCD_DISCOVERY_URL"
EOF

Remove incorrect variable in etcd.conf
Remove incorrect variable in etcd.conf

As described in [1], the line [cluster] in /etc/etcd/etcd.conf
is incorrect. It is interpreted as an environment variable
without a value and ignored which is said by a systemd developer
on #systemd irc channel. The comments "# [member]" is not necessary.

[1] http://www.freedesktop.org/software/systemd/man/
systemd.exec.html#EnvironmentFile=

Change-Id: Iceb71540c04f93da16f9469f545c0b19a6cf58db
Closes-Bug: #1481269
