diff --git a/roles/edpm_network_config/defaults/main.yml b/roles/edpm_network_config/defaults/main.yml index d5266db7b..8911ba1dc 100644 --- a/roles/edpm_network_config/defaults/main.yml +++ b/roles/edpm_network_config/defaults/main.yml @@ -22,11 +22,14 @@ # This variable let the use choose which tool will be used to configure networking on hosts # Accepted values are: # * os-net-config (default) -> the os-net-config will be used -# * nmstate -> the network role from linux-system-roles/rhel-system-roles will be used to +# * nmstate (experimental, unsupported) -> the network role from linux-system-roles/rhel-system-roles will be used to # configure networking on hosts. In particular, the nmstate tool should cover all the # supported scenario. Refer to nmstate.io for configuration snippets. edpm_network_config_tool: os-net-config +# Must be set to true to allow usage of nmstate as edpm_network_config_tool +edpm_network_config_tool_nmstate_override: false + # Packages needed by nmstate (via system-role) edpm_network_config_systemrole_nmstate_dependencies: - NetworkManager-ovs diff --git a/roles/edpm_network_config/meta/argument_specs.yml b/roles/edpm_network_config/meta/argument_specs.yml index dc421ce24..9c8c56c2c 100644 --- a/roles/edpm_network_config/meta/argument_specs.yml +++ b/roles/edpm_network_config/meta/argument_specs.yml @@ -24,7 +24,7 @@ argument_specs: default: os-net-config choices: - os-net-config - - nmstate + - nmstate (experimental, unsupported) edpm_network_config_update: type: bool description: Apply NetworkConfig or not diff --git a/roles/edpm_network_config/molecule/nmstate/converge.yml b/roles/edpm_network_config/molecule/nmstate/converge.yml index f99e338a6..f765a26c4 100644 --- a/roles/edpm_network_config/molecule/nmstate/converge.yml +++ b/roles/edpm_network_config/molecule/nmstate/converge.yml @@ -21,6 +21,7 @@ vars: # edpm_network_config - nmstate edpm_network_config_tool: 'nmstate' + edpm_network_config_tool_nmstate_override: true edpm_network_config_template: | --- interfaces: diff --git a/roles/edpm_network_config/tasks/main.yml b/roles/edpm_network_config/tasks/main.yml index afed98124..d63c7be89 100644 --- a/roles/edpm_network_config/tasks/main.yml +++ b/roles/edpm_network_config/tasks/main.yml @@ -14,6 +14,15 @@ # License for the specific language governing permissions and limitations # under the License. +- name: Fail when edpm_network_config_tool=nmstate unless edpm_network_config_tool_nmstate_override=true + ansible.builtin.fail: + msg: | + edpm_network_config_tool=nmstate is experimental and not supported. + Set edpm_network_config_tool_nmstate_override=true to continue anyway. + when: + - edpm_network_config_tool == 'nmstate' + - not edpm_network_config_tool_nmstate_override|bool + - name: Configure network with network role from system roles [nmstate] when: edpm_network_config_tool == 'nmstate' become: true