Skip to content

Commit

Permalink
Document nmstate as experimental and require an override to use it
Browse files Browse the repository at this point in the history
"edpm_network_config_tool: nmstate" is experimental and officially
unsupported. This change will require users to explicitly opt-in to
using nmstate directly instead of using os-net-config+nmstate. It adds a
task that will fail unless edpm_network_config_tool_nmstate_override is
set to true (defaults to false).

Signed-off-by: James Slagle <[email protected]>
Jira: https://issues.redhat.com/browse/OSPRH-12316
  • Loading branch information
slagle committed Dec 10, 2024
1 parent ef239bb commit 31305f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion roles/edpm_network_config/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions roles/edpm_network_config/molecule/nmstate/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions roles/edpm_network_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31305f0

Please sign in to comment.