mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 11:51:14 +02:00
feat(coreos-base/oem-gce): add the gce-add-metadata-host service
One of the requirements of GCE is setting up the metadata host. Do this.
This commit is contained in:
parent
dbd1895f49
commit
4c85c26dcb
@ -2,6 +2,15 @@
|
||||
|
||||
coreos:
|
||||
units:
|
||||
- name: gce-add-metadata-host.service
|
||||
command: start
|
||||
runtime: yes
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Setup metadata in /etc/hosts
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/share/oem/bin/gce-add-metadata-host
|
||||
- name: gce-coreos-cloudinit.service
|
||||
command: restart
|
||||
runtime: yes
|
||||
|
||||
9
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/gce-add-metadata-host
vendored
Executable file
9
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/gce-add-metadata-host
vendored
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
entry="169.254.169.254 metadata"
|
||||
|
||||
grep -q "${entry}" /etc/hosts
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo ${entry} >> /etc/hosts
|
||||
fi
|
||||
@ -25,6 +25,7 @@ src_install() {
|
||||
dobin ${FILESDIR}/gce-ssh-key
|
||||
dobin ${FILESDIR}/gce-coreos-cloudinit
|
||||
dobin ${FILESDIR}/gce-setup-environment
|
||||
dobin ${FILESDIR}/gce-add-metadata-host
|
||||
|
||||
insinto "/usr/share/oem"
|
||||
doins ${FILESDIR}/cloud-config.yml
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user