Skip to content

Commit d9efb10

Browse files
committed
EDPM deployment should not do network cleanup by default
With nmstate-provider set as default for os-net-config, default cleanup during update/adoption is not desired. Updated description for the proper usage of this flag Signed-off-by: <[email protected]> Jira: https://issues.redhat.com/browse/OSPRH-16537 https://issues.redhat.com/browse/OSPRH-17036 Signed-off-by: vcandapp <[email protected]>
1 parent 4f55513 commit d9efb10

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

docs/source/roles/role-edpm_network_config.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ This Ansible role does the following tasks:
1919
- Checks for the presence of required RPMS
2020
- Uses "provider" ifcfg/nmstate based on flag "edpm_network_config_nmstate"
2121

22-
Note: By default this role will cleanup devices/interfaces not in
23-
"edpm_network_config_template". If there is requirement to keep them
24-
for pre-provisioned nodes, "edpm_network_config_nonconfigured_cleanup"
25-
ansible var can be set to "false".
22+
Note: * With nmstate-provider as the default for os-net-config,
23+
"os-net-config --cleanup" should be used only for very
24+
specific use case, eg
25+
- SSH provisioned over VLAN-tagged single interface
26+
- os-net-config needs to override ctlplane over bond+VLAN
27+
28+
* "os-net-config --cleanup" SHOULD NOT be set for update/adoption
29+
use case
2630

2731
Here is an example playbook to run os-net-config tool:
2832

plugins/modules/edpm_os_net_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
requirements:
4040
- os-net-config
4141
description:
42-
- Configure host network interfaces using a JSON config file format.
42+
- Configure host network interfaces using a YAML/JSON config file format.
4343
options:
4444
cleanup:
4545
description:
46-
- Cleanup unconfigured interfaces.
46+
- Cleanup unconfigured interfaces, before applying.
4747
type: bool
4848
default: false
4949
config_file:
@@ -69,9 +69,9 @@
6969
default: false
7070
use_nmstate:
7171
description:
72-
- If enabled, use nmstate and network manager for network configuration.
72+
- If disabled, use legacy ifcfg/network-scripts for network configuration.
7373
type: bool
74-
default: false
74+
default: true
7575
"""
7676

7777
EXAMPLES = """

roles/edpm_network_config/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ edpm_network_config_safe_defaults: false
5454
edpm_network_config_template: ""
5555
edpm_bond_interface_ovs_options: "bond_mode=active-backup"
5656
edpm_dns_search_domains: []
57-
edpm_network_config_nonconfigured_cleanup: true
5857
# Control resolv.conf management by NetworkManager
5958
# false = disable NetworkManager resolv.conf update (default)
6059
# true = enable NetworkManager resolv.conf updat
6160
edpm_bootstrap_network_resolvconf_update: "{{ edpm_network_config_nmstate | default(True) }}"
61+
edpm_network_config_nonconfigured_cleanup: false

roles/edpm_network_config/meta/argument_specs.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,16 @@ argument_specs:
8181
default: nic1
8282
edpm_network_config_nonconfigured_cleanup:
8383
type: bool
84-
description: "Cleanup network interfaces not in network config"
85-
default: true
84+
description: >
85+
Cleanup interfaces not defined in the network configa.
86+
Usage:
87+
- If there are any ifcfg/nm interfaces which you need to clean
88+
before applying the desired config, set this flag to 'true'
89+
- During network_update, if cleanup is needed for any interfaces
90+
Warning!
91+
- Cleanup of ssh interface might result in connectivity loss
92+
- Cleanup of DPDK/SR-IOV interfaces is not supported
93+
default: false
8694
edpm_bootstrap_network_resolvconf_update:
8795
type: bool
8896
default: true

roles/edpm_network_config/molecule/nmstate/converge.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17-
1817
- name: Converge
1918
hosts: all
2019
gather_facts: false
@@ -30,9 +29,11 @@
3029
state: up
3130
ipv4:
3231
address:
33-
- ip: 192.168.180.2
34-
prefix-length: 24
32+
- ip: 192.168.180.2
33+
prefix-length: 24
3534
dhcp: false
3635
enabled: true
36+
ipv6:
37+
enabled: false
3738
roles:
3839
- role: osp.edpm.edpm_network_config

0 commit comments

Comments
 (0)