Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ifupdown: T6038: Cleanup network config properly #74

Merged
merged 1 commit into from
May 16, 2024

Conversation

zdc
Copy link
Contributor

@zdc zdc commented May 16, 2024

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.

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.
@zdc zdc merged commit 70304ff into vyos:current May 16, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant