mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-03 11:32:02 +02:00
Merge pull request #149 from polvi/etcd-bootstrap
feat(oem-service): make etcd bootstrapping optional, and only supported ...
This commit is contained in:
commit
8aac92d989
1
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/oem-release
vendored
Normal file
1
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/oem-release
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
ec2
|
@ -1 +0,0 @@
|
|||||||
oem-ami-0.0.1.ebuild
|
|
@ -20,4 +20,7 @@ src_install() {
|
|||||||
|
|
||||||
exeinto "/"
|
exeinto "/"
|
||||||
doexe ${FILESDIR}/run.sh
|
doexe ${FILESDIR}/run.sh
|
||||||
|
|
||||||
|
insinto "/"
|
||||||
|
doins ${FILESDIR}/oem-release
|
||||||
}
|
}
|
||||||
|
13
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/files/coreos-detect-virt
vendored
Executable file
13
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/files/coreos-detect-virt
vendored
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
OEM_RELEASE="/usr/share/oem/oem-release"
|
||||||
|
|
||||||
|
VIRT=
|
||||||
|
|
||||||
|
if [ -e "${OEM_RELEASE}" ]; then
|
||||||
|
VIRT=$(cat ${OEM_RELEASE})
|
||||||
|
else
|
||||||
|
VIRT=$(systemd-detect-virt)
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $VIRT
|
@ -19,6 +19,7 @@ IUSE=""
|
|||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
dobin ${FILESDIR}/run-oem.sh
|
dobin ${FILESDIR}/run-oem.sh
|
||||||
|
dobin ${FILESDIR}/coreos-detect-virt
|
||||||
|
|
||||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||||
systemd_enable_service multi-user.target ${PN}.service
|
systemd_enable_service multi-user.target ${PN}.service
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
VIRT=$(coreos-detect-virt)
|
||||||
|
|
||||||
|
if [ "${VIRT}" != "ec2" ]; then
|
||||||
|
# all of this is currently dependent on ec2, we'll refactor as we add more images
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
C10N_ENDPOINT=https://core-api.appspot.com/v1/c10n/group
|
C10N_ENDPOINT=https://core-api.appspot.com/v1/c10n/group
|
||||||
META_URL="http://169.254.169.254/latest"
|
META_URL="http://169.254.169.254/latest"
|
||||||
|
|
||||||
|
@ -1,14 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
STATE=/var/lib/etcd
|
||||||
|
mkdir -p $STATE
|
||||||
|
|
||||||
|
VIRT=$(coreos-detect-virt)
|
||||||
|
|
||||||
|
if [ "${VIRT}" != "ec2" ]; then
|
||||||
|
echo "Detected environment \"${VIRT}\", just starting solo master..."
|
||||||
|
exec /usr/bin/etcd -v -d $STATE
|
||||||
|
fi
|
||||||
|
|
||||||
/usr/bin/coreos-c10n
|
/usr/bin/coreos-c10n
|
||||||
|
|
||||||
META_URL="http://169.254.169.254/latest"
|
META_URL="http://169.254.169.254/latest"
|
||||||
MY_IP=$(curl -s $META_URL/meta-data/local-ipv4)
|
MY_IP=$(curl -s $META_URL/meta-data/local-ipv4)
|
||||||
BOOTSTRAP="/var/run/etcd/bootstrap.config"
|
BOOTSTRAP="/var/run/etcd/bootstrap.config"
|
||||||
|
|
||||||
# for etcd
|
|
||||||
STATE=/var/lib/etcd
|
|
||||||
mkdir -p $STATE
|
|
||||||
|
|
||||||
[ ! -e $BOOTSTRAP ] && echo bootstrap config missing && exit 1
|
[ ! -e $BOOTSTRAP ] && echo bootstrap config missing && exit 1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user