From 02d7ea9908f726dc6a363f28942f4edb7d350340 Mon Sep 17 00:00:00 2001 From: zsdc Date: Thu, 16 May 2024 03:12:08 +0300 Subject: ifupdown: T6038: Cleanup network config properly Cloud-init in environments where Meta-data is available via network configures the main interface and keeps the config in `/etc/network/interfaces.d/`. This config later interferes with the VyOS configuration. To avoid the problem previously the code in the `cc_vyos.py` module was used, but this is not enough. The module is running only once during instance deployment. But Cloud-init will re-add the config file with each boot. There are two ways to solve this incompatibility (within Cloud-init) - disable network config or perform cleanup during each boot. Disabling network config is not correct in this context, because it blocks the ability to fetch Meta-data after the first boot, which in turn blocks the ability to run per-boot modules with an updated config. Therefore, the cleanup code was extracted to an independent `cc_vyos_ifupdown.py` module that performs proper cleanup with each boot. --- config/cloud.cfg.d/10_vyos.cfg | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/cloud.cfg.d/10_vyos.cfg b/config/cloud.cfg.d/10_vyos.cfg index d4415126..f34e262a 100644 --- a/config/cloud.cfg.d/10_vyos.cfg +++ b/config/cloud.cfg.d/10_vyos.cfg @@ -19,6 +19,7 @@ cloud_init_modules: # The modules that run in the 'config' stage cloud_config_modules: + - vyos_ifupdown - vyos - write_files - vyos_userdata -- cgit v1.2.3