Skip to content

Commit

Permalink
Add ansible var to cleanup non configured interfaces
Browse files Browse the repository at this point in the history
This would allow to remove interfaces that exist but aren't specified
in the provided nic config, if required.

Jira: https://issues.redhat.com/browse/OSPRH-13433
Signed-off-by: rabi <[email protected]>
  • Loading branch information
rabi committed Jan 27, 2025
1 parent ec4f092 commit 788c647
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/edpm_network_config/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ edpm_network_config_safe_defaults: true
edpm_network_config_template: ""
edpm_bond_interface_ovs_options: "bond_mode=active-backup"
edpm_dns_search_domains: []
edpm_network_config_nonconfigured_cleanup: false
4 changes: 4 additions & 0 deletions roles/edpm_network_config/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ argument_specs:
type: str
description: "Name of the public network interface"
default: nic1
edpm_network_config_nonconfigured_cleanup:
type: bool
description: "Cleanup network interfaces not in network config"
default: false
1 change: 1 addition & 0 deletions roles/edpm_network_config/tasks/os_net_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
msg: "{{ os_net_config_config['content'] | b64decode | trim }}"
- name: Run edpm_os_net_config_module with network_config
edpm_os_net_config:
cleanup: "{{ edpm_network_config_nonconfigured_cleanup }}"
config_file: "{{ nic_config_file }}"
debug: "{{ edpm_network_config_debug | bool }}"
detailed_exit_codes: true
Expand Down

0 comments on commit 788c647

Please sign in to comment.