summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2024-05-16 03:12:08 +0300
committerzdc <zdc@users.noreply.github.com>2024-05-16 03:13:51 +0300
commit70304ff90d931265cb736ace692967242c9b9729 (patch)
tree02d5487084e01b9d2c5546d4dff2729938f64100 /config
parentfd8c12784127e3258762d0163455d595b427ea53 (diff)
downloadvyos-cloud-init-70304ff90d931265cb736ace692967242c9b9729.tar.gz
vyos-cloud-init-70304ff90d931265cb736ace692967242c9b9729.zip
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.
Diffstat (limited to 'config')
-rw-r--r--config/cloud.cfg.d/10_vyos.cfg1
1 files changed, 1 insertions, 0 deletions
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