Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/source/roles/role-edpm_network_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ This Ansible role does the following tasks:
- Checks for the presence of required RPMS
- Uses "provider" ifcfg/nmstate based on flag "edpm_network_config_nmstate"

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

* "os-net-config --cleanup" SHOULD NOT be set for update/adoption
use case

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

Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/edpm_os_net_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
requirements:
- os-net-config
description:
- Configure host network interfaces using a JSON config file format.
- Configure host network interfaces using a YAML/JSON config file format.
options:
cleanup:
description:
- Cleanup unconfigured interfaces.
- Cleanup unconfigured interfaces, before applying.
type: bool
default: false
config_file:
Expand All @@ -69,9 +69,9 @@
default: false
use_nmstate:
description:
- If enabled, use nmstate and network manager for network configuration.
- If disabled, use legacy ifcfg/network-scripts for network configuration.
type: bool
default: false
default: true
"""

EXAMPLES = """
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_network_config/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ edpm_network_config_safe_defaults: false
edpm_network_config_template: ""
edpm_bond_interface_ovs_options: "bond_mode=active-backup"
edpm_dns_search_domains: []
edpm_network_config_nonconfigured_cleanup: true
# Control resolv.conf management by NetworkManager
# false = disable NetworkManager resolv.conf update (default)
# true = enable NetworkManager resolv.conf updat
edpm_bootstrap_network_resolvconf_update: "{{ edpm_network_config_nmstate | default(True) }}"
edpm_network_config_nonconfigured_cleanup: false
12 changes: 10 additions & 2 deletions roles/edpm_network_config/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ argument_specs:
default: nic1
edpm_network_config_nonconfigured_cleanup:
type: bool
description: "Cleanup network interfaces not in network config"
default: true
description: >
Cleanup interfaces not defined in the network configa.
Usage:
- If there are any ifcfg/nm interfaces which you need to clean
before applying the desired config, set this flag to 'true'
- During network_update, if cleanup is needed for any interfaces
Warning!
- Cleanup of ssh interface might result in connectivity loss
- Cleanup of DPDK/SR-IOV interfaces is not supported
default: false
edpm_bootstrap_network_resolvconf_update:
type: bool
default: true
Expand Down
7 changes: 4 additions & 3 deletions roles/edpm_network_config/molecule/nmstate/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.


- name: Converge
hosts: all
gather_facts: false
Expand All @@ -30,9 +29,11 @@
state: up
ipv4:
address:
- ip: 192.168.180.2
prefix-length: 24
- ip: 192.168.180.2
prefix-length: 24
dhcp: false
enabled: true
ipv6:
enabled: false
roles:
- role: osp.edpm.edpm_network_config