diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-c10n b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-c10n index b97a07e779..486935fe77 100755 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-c10n +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-c10n @@ -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 diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-setup-environment b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-setup-environment index c148d23fe3..4e3b0c4dee 100755 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-setup-environment +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/coreos-setup-environment @@ -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") diff --git a/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/etcd-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/etcd-9999.ebuild index ea8c96f046..6072824a15 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/etcd-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/etcd-9999.ebuild @@ -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 } diff --git a/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/etcd.service b/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/etcd.service index 1f903ecd1e..946f52650d 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/etcd.service +++ b/sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/etcd.service @@ -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