mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-20 14:01:36 +02:00
Merge pull request #716 from marineam/rollback
Rollback to last working cloudinit
This commit is contained in:
commit
db5984fe48
@ -9,7 +9,7 @@ CROS_WORKON_REPO="git://github.com"
|
|||||||
if [[ "${PV}" == 9999 ]]; then
|
if [[ "${PV}" == 9999 ]]; then
|
||||||
KEYWORDS="~amd64"
|
KEYWORDS="~amd64"
|
||||||
else
|
else
|
||||||
CROS_WORKON_COMMIT="43be8c89965f4b1d19082742a0a3db27a3c103dd" # tag v0.8.6
|
CROS_WORKON_COMMIT="d0a6d6f92f376e9fea26f0291c753c39504ffc9c" # tag v0.7.7
|
||||||
KEYWORDS="amd64"
|
KEYWORDS="amd64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2,11 +2,18 @@
|
|||||||
|
|
||||||
coreos:
|
coreos:
|
||||||
units:
|
units:
|
||||||
- name: user-configdrive.service
|
- name: ec2-ssh-key.service
|
||||||
mask: yes
|
command: restart
|
||||||
- name: user-configvirtfs.service
|
runtime: yes
|
||||||
mask: yes
|
content: |
|
||||||
- name: oem-cloudinit.service
|
[Unit]
|
||||||
|
Description=Sets SSH key from metadata
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
StandardOutput=journal+console
|
||||||
|
ExecStart=/usr/share/oem/bin/ec2-ssh-key
|
||||||
|
- name: ec2-cloudinit.service
|
||||||
command: restart
|
command: restart
|
||||||
runtime: yes
|
runtime: yes
|
||||||
content: |
|
content: |
|
||||||
@ -18,7 +25,7 @@ coreos:
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
EnvironmentFile=/etc/environment
|
EnvironmentFile=/etc/environment
|
||||||
ExecStart=/usr/bin/coreos-cloudinit --from-configdrive=/media/configdrive --from-metadata-service
|
ExecStart=/usr/bin/coreos-cloudinit -ignore-failure=true -from-url=http://169.254.169.254/latest/user-data
|
||||||
oem:
|
oem:
|
||||||
id: @@OEM_ID@@
|
id: @@OEM_ID@@
|
||||||
name: @@OEM_NAME@@
|
name: @@OEM_NAME@@
|
||||||
|
29
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/coreos-setup-environment
vendored
Executable file
29
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/coreos-setup-environment
vendored
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ENV=$1
|
||||||
|
|
||||||
|
if [ -z "$ENV" ]; then
|
||||||
|
echo usage: $0 /etc/environment
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# test for rw
|
||||||
|
touch $ENV
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo exiting, unable to modify: $ENV
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
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")
|
||||||
|
echo COREOS_PUBLIC_IPV4=${IP} >> $ENV
|
||||||
|
|
||||||
|
PRIV_IP_URL=http://169.254.169.254/latest/meta-data/local-ipv4
|
||||||
|
IP=$(/usr/bin/curl --fail -s "$PRIV_IP_URL")
|
||||||
|
echo COREOS_PRIVATE_IPV4=${IP} >> $ENV
|
6
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/ec2-ssh-key
vendored
Executable file
6
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/ec2-ssh-key
vendored
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
KEY_URL="http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key"
|
||||||
|
|
||||||
|
/usr/bin/block-until-url "$KEY_URL"
|
||||||
|
/usr/bin/curl --fail -s "$KEY_URL" | /usr/bin/update-ssh-keys -a ec2
|
@ -0,0 +1 @@
|
|||||||
|
oem-ec2-compat-0.0.1.ebuild
|
@ -40,6 +40,10 @@ src_prepare() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
|
into "/usr/share/oem"
|
||||||
|
dobin ${FILESDIR}/ec2-ssh-key
|
||||||
|
dobin ${FILESDIR}/coreos-setup-environment
|
||||||
|
|
||||||
insinto "/usr/share/oem"
|
insinto "/usr/share/oem"
|
||||||
doins ${T}/cloud-config.yml
|
doins ${T}/cloud-config.yml
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user