From 748199b10df112cba0821703001c0307e325bd90 Mon Sep 17 00:00:00 2001 From: zsdc Date: Thu, 4 May 2023 22:41:40 +0300 Subject: 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 --- data/templates/system/cloud_init_networking.tmpl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 data/templates/system/cloud_init_networking.tmpl (limited to 'data/templates') diff --git a/data/templates/system/cloud_init_networking.tmpl b/data/templates/system/cloud_init_networking.tmpl new file mode 100644 index 000000000..52cce72f8 --- /dev/null +++ b/data/templates/system/cloud_init_networking.tmpl @@ -0,0 +1,9 @@ +network: + version: 2 + ethernets: +{% for iface in ifaces_list %} + {{ iface['name'] }}: + dhcp4: true + match: + macaddress: "{{ iface['mac'] }}" +{% endfor %} -- cgit v1.2.3