mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-20 05:51:18 +02:00
Merge pull request #719 from marineam/no-env
Remove environment dependency, roll forward again.
This commit is contained in:
commit
3d200d96fa
@ -9,7 +9,7 @@ CROS_WORKON_REPO="git://github.com"
|
||||
if [[ "${PV}" == 9999 ]]; then
|
||||
KEYWORDS="~amd64"
|
||||
else
|
||||
CROS_WORKON_COMMIT="d0a6d6f92f376e9fea26f0291c753c39504ffc9c" # tag v0.7.7
|
||||
CROS_WORKON_COMMIT="43be8c89965f4b1d19082742a0a3db27a3c103dd" # tag v0.8.6
|
||||
KEYWORDS="amd64"
|
||||
fi
|
||||
|
||||
|
@ -2,30 +2,20 @@
|
||||
|
||||
coreos:
|
||||
units:
|
||||
- name: ec2-ssh-key.service
|
||||
command: restart
|
||||
runtime: yes
|
||||
content: |
|
||||
[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
|
||||
- name: user-configdrive.service
|
||||
mask: yes
|
||||
- name: user-configvirtfs.service
|
||||
mask: yes
|
||||
- name: oem-cloudinit.service
|
||||
command: restart
|
||||
runtime: yes
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Cloudinit from EC2-style metadata
|
||||
Requires=coreos-setup-environment.service
|
||||
After=coreos-setup-environment.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/environment
|
||||
ExecStart=/usr/bin/coreos-cloudinit -ignore-failure=true -from-url=http://169.254.169.254/latest/user-data
|
||||
ExecStart=/usr/bin/coreos-cloudinit --from-configdrive=/media/configdrive --from-metadata-service
|
||||
oem:
|
||||
id: @@OEM_ID@@
|
||||
name: @@OEM_NAME@@
|
||||
|
@ -1,29 +0,0 @@
|
||||
#!/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
|
@ -1,6 +0,0 @@
|
||||
#!/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
|
@ -1 +0,0 @@
|
||||
oem-ec2-compat-0.0.1.ebuild
|
@ -40,10 +40,6 @@ src_prepare() {
|
||||
}
|
||||
|
||||
src_install() {
|
||||
into "/usr/share/oem"
|
||||
dobin ${FILESDIR}/ec2-ssh-key
|
||||
dobin ${FILESDIR}/coreos-setup-environment
|
||||
|
||||
insinto "/usr/share/oem"
|
||||
doins ${T}/cloud-config.yml
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user