Skip to content

Detect and backup conflicting netplan configuration files for netremote-config-netplan package#262

Merged
abeltrano merged 3 commits into
developfrom
netplancleanconfig
May 10, 2024
Merged

Detect and backup conflicting netplan configuration files for netremote-config-netplan package#262
abeltrano merged 3 commits into
developfrom
netplancleanconfig

Conversation

@abeltrano
Copy link
Copy Markdown
Contributor

@abeltrano abeltrano commented May 10, 2024

Type

  • Bug fix
  • Feature addition
  • Feature update
  • Documentation
  • Build Infrastructure

Side Effects

  • Breaking change
  • Non-functional change

Goals

  • Ensure pre-existing netplan configuration files don't conflict with generated netplan configuration.

Technical Details

Netplan cli tooling handles conflicting configuration in multiple yaml files by wholly deleting conflicting sections without any notice. Some distributions come with canned netplan configuration, such as that provided by cloud-init for ubuntu 23.10 (mantic). As such, incorporation of our generated netplan configuration files can fail due to pre-existing netplan configuration.

  • Remove all existing netplan configuration files in /{etc,lib,run}/netplan per netplan documentation by appending the file name with a timestamp and the .bak extension suffix. Eg. /etc/netplan/10-network-netremote-all.yaml -> /etc/netplan/10-network-netremote-all.yaml.20240510-054348.bak.
  • Rename 10-network-netremote-all-template.yaml to 10-network-netremote-all.yaml and install it to /etc/netplan as 10-network-netremote-all.yaml.template (note the .template suffix) such that it is not considered for inclusion in netplan configuration processing.
  • Fix typo in bash variables NETPLAT_CONFIGURATION_FILE_REVIEW_SECONDS -> NETPLAN_CONFIGURATION_FILE_REVIEW_SECONDS, NETPLAT_CONFIGURATION_FILE_REVIEW_SECONDS_DEBUG -> NETPLAN_CONFIGURATION_FILE_REVIEW_SECONDS_DEBUG.

Test Results

  • Add .yml. and .yaml files to all of /etc/netplan, /lib/netplan, and /run/netplan, installed the netremote-config-netplan.deb package, applied the generated netplan configuration, and verified the expected output (bridge created, IP address obtained, connectivity maintained).

Reviewer Focus

  • None

Future Work

  • None

Checklist

  • Build target all compiles cleanly.
  • clang-format and clang-tidy deltas produced no new output.
  • Newly added functions include doxygen-style comment block.

@abeltrano abeltrano requested a review from a team as a code owner May 10, 2024 05:58
@abeltrano abeltrano force-pushed the netplancleanconfig branch from f0bc70a to b93885f Compare May 10, 2024 06:00
@abeltrano abeltrano force-pushed the netplancleanconfig branch from b93885f to 8962149 Compare May 10, 2024 06:03
@abeltrano abeltrano merged commit fb13408 into develop May 10, 2024
@abeltrano abeltrano deleted the netplancleanconfig branch May 10, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant