summaryrefslogtreecommitdiff
path: root/src/systemd
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2023-05-04 22:41:40 +0300
committerzsdc <taras@vyos.io>2023-05-04 22:41:40 +0300
commit748199b10df112cba0821703001c0307e325bd90 (patch)
tree466618fb5ff2867d511d375cf82dbdacb3237d6e /src/systemd
parent2c5307d42e0d4cc1a81210c76a63271d66f2888b (diff)
downloadvyos-1x-748199b10df112cba0821703001c0307e325bd90.tar.gz
vyos-1x-748199b10df112cba0821703001c0307e325bd90.zip
cloud-init: T5190: Added Cloud-init pre-configurator
Added a new service that starts before Cloud-init, waits for all network interfaces initialization, and if requested by config, checks which interfaces can get configuration via DHCP server and creates a corresponding Cloud-init network configuration. This protects from two situations: * when Cloud-init tries to get meta-data via eth0 (default and fallback variant for any data source which depends on network), but the real network is connected to another interface * when Cloud-init starts simultaneously with udev and initializes the first interface to get meta-data before it is renamed to eth0 by udev
Diffstat (limited to 'src/systemd')
-rw-r--r--src/systemd/vyos-config-cloud-init.service19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/systemd/vyos-config-cloud-init.service b/src/systemd/vyos-config-cloud-init.service
new file mode 100644
index 000000000..ba6f90e6d
--- /dev/null
+++ b/src/systemd/vyos-config-cloud-init.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Pre-configure Cloud-init
+DefaultDependencies=no
+Requires=systemd-remount-fs.service
+Requires=systemd-udevd.service
+Wants=network-pre.target
+After=systemd-remount-fs.service
+After=systemd-udevd.service
+Before=cloud-init-local.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/libexec/vyos/system/vyos-config-cloud-init.py
+TimeoutSec=120
+KillMode=process
+StandardOutput=journal+console
+
+[Install]
+WantedBy=cloud-init-local.service