updates from testing

This commit is contained in:
Alex Polvi 2014-03-18 01:17:17 +00:00
parent d9e5aa902f
commit 141dba89cd
4 changed files with 8 additions and 14 deletions

View File

@ -66,11 +66,8 @@ if head -n 1 $TMP | grep -q '^#!'; then
# If user-data is a cloud-config, do not do c10n
elif head -n 1 $TMP | grep -q '^#cloud-config'; then
# If an etcd discovery URL was found, we can assume the new hotness
# will handle bootstrapping, allowing us to clear the c10n token
if grep -q 'discovery_url:' $TMP; then
C10N_TOKEN=""
fi
# no c10n if this is a cloudconfig
C10N_TOKEN=""
# Validate the user-data as an SSH key, installing it if so
else
@ -101,8 +98,10 @@ elif [ -n "${C10N_TOKEN}" ]; then
IP=$(curl -s $META_URL/meta-data/local-ipv4)
# XXX: change to append a valid ETCD_PEERS to /usr/share/oem/etcd.env
ETCD_PEERS=$(curl -s $C10N_ENDPOINT -d "c10n_url=$C10N_TOKEN" -d"ip_list=$IP")
echo "[Service]
Environment=ETCD_PEERS=${ETCD_PEERS}" > ${ETCD_SERVICE_D}/12-c10n.conf
echo "[Service]" > ${ETCD_SERVICE_D}/12-c10n.conf
for peer in $ETCD_PEERS; do
echo "Environment=ETCD_PEERS=${peer}" >> ${ETCD_SERVICE_D}/12-c10n.conf
done
fi
if [ "$START_FLEET" = "1" ]; then

View File

@ -17,6 +17,8 @@ sed -i -e '/^COREOS_PUBLIC_IPV4=/d' \
-e '/^COREOS_PRIVATE_IPV4=/d' \
"${ENV}"
/usr/bin/block-until-url http://169.254.169.254/latest/meta-data/public-ipv4
# get public ip from metadata
PUB_IP_URL=http://169.254.169.254/latest/meta-data/public-ipv4
IP=$(/usr/bin/curl --fail -s "$PUB_IP_URL")

View File

@ -36,6 +36,5 @@ src_install() {
dobin ${S}/bin/${PN}
systemd_dounit "${FILESDIR}"/${PN}.service
systemd_enable_service multi-user.target ${PN}.service
systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
}

View File

@ -1,14 +1,8 @@
[Unit]
Description=etcd
# this will setup cloudinit and user envs
Wants=coreos-cloudinit-oem.service
After=coreos-cloudinit-oem.service
[Service]
User=etcd
PermissionsStartOnly=true
Environment=ETCD_DATA_DIR=/var/lib/etcd ETCD_NAME=default
ExecStart=/usr/bin/etcd
[Install]
WantedBy=multi-user.target