mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-17 18:06:59 +02:00
updates from testing
This commit is contained in:
parent
d9e5aa902f
commit
141dba89cd
@ -66,11 +66,8 @@ if head -n 1 $TMP | grep -q '^#!'; then
|
|||||||
|
|
||||||
# If user-data is a cloud-config, do not do c10n
|
# If user-data is a cloud-config, do not do c10n
|
||||||
elif head -n 1 $TMP | grep -q '^#cloud-config'; then
|
elif head -n 1 $TMP | grep -q '^#cloud-config'; then
|
||||||
# If an etcd discovery URL was found, we can assume the new hotness
|
# no c10n if this is a cloudconfig
|
||||||
# will handle bootstrapping, allowing us to clear the c10n token
|
C10N_TOKEN=""
|
||||||
if grep -q 'discovery_url:' $TMP; then
|
|
||||||
C10N_TOKEN=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Validate the user-data as an SSH key, installing it if so
|
# Validate the user-data as an SSH key, installing it if so
|
||||||
else
|
else
|
||||||
@ -101,8 +98,10 @@ elif [ -n "${C10N_TOKEN}" ]; then
|
|||||||
IP=$(curl -s $META_URL/meta-data/local-ipv4)
|
IP=$(curl -s $META_URL/meta-data/local-ipv4)
|
||||||
# XXX: change to append a valid ETCD_PEERS to /usr/share/oem/etcd.env
|
# 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")
|
ETCD_PEERS=$(curl -s $C10N_ENDPOINT -d "c10n_url=$C10N_TOKEN" -d"ip_list=$IP")
|
||||||
echo "[Service]
|
echo "[Service]" > ${ETCD_SERVICE_D}/12-c10n.conf
|
||||||
Environment=ETCD_PEERS=${ETCD_PEERS}" > ${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
|
fi
|
||||||
|
|
||||||
if [ "$START_FLEET" = "1" ]; then
|
if [ "$START_FLEET" = "1" ]; then
|
||||||
|
@ -17,6 +17,8 @@ sed -i -e '/^COREOS_PUBLIC_IPV4=/d' \
|
|||||||
-e '/^COREOS_PRIVATE_IPV4=/d' \
|
-e '/^COREOS_PRIVATE_IPV4=/d' \
|
||||||
"${ENV}"
|
"${ENV}"
|
||||||
|
|
||||||
|
/usr/bin/block-until-url http://169.254.169.254/latest/meta-data/public-ipv4
|
||||||
|
|
||||||
# get public ip from metadata
|
# get public ip from metadata
|
||||||
PUB_IP_URL=http://169.254.169.254/latest/meta-data/public-ipv4
|
PUB_IP_URL=http://169.254.169.254/latest/meta-data/public-ipv4
|
||||||
IP=$(/usr/bin/curl --fail -s "$PUB_IP_URL")
|
IP=$(/usr/bin/curl --fail -s "$PUB_IP_URL")
|
||||||
|
@ -36,6 +36,5 @@ src_install() {
|
|||||||
dobin ${S}/bin/${PN}
|
dobin ${S}/bin/${PN}
|
||||||
|
|
||||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||||
systemd_enable_service multi-user.target ${PN}.service
|
|
||||||
systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
|
systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=etcd
|
Description=etcd
|
||||||
# this will setup cloudinit and user envs
|
|
||||||
Wants=coreos-cloudinit-oem.service
|
|
||||||
After=coreos-cloudinit-oem.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=etcd
|
User=etcd
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
Environment=ETCD_DATA_DIR=/var/lib/etcd ETCD_NAME=default
|
Environment=ETCD_DATA_DIR=/var/lib/etcd ETCD_NAME=default
|
||||||
ExecStart=/usr/bin/etcd
|
ExecStart=/usr/bin/etcd
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
|
Loading…
Reference in New Issue
Block a user