Skip to content

nmcli type vrf not idempotent #9989

Open
@mstinsky

Description

@mstinsky

Summary

When creating a NM connection type vrf through the nmcli module with a table id the task is not idempotent.

Reason beeing seems to be that the nmcli module sets table but in nmcli it is saved as vrf.table:

nmcli connection show vrf_mgmt | grep table
...
vrf.table:                              1001

Issue Type

Bug Report

Component Name

nmcli

Ansible Version

bash-5.1$ ansible --version
ansible [core 2.17.3]
  config file = /home/mstinsky/ws/marc/ansible/control/ansible.cfg
  configured module search path = ['/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
  ansible collection location = /runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.12.5 (main, Apr  2 2025, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] (/usr/bin/python3.12)
  jinja version = 3.1.6
  libyaml = True

Community.general Version

bash-5.1$ ansible-galaxy collection list community.general

# /usr/share/ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 10.5.0

Configuration

OS / Environment

nmcli --version
nmcli tool, version 1.48.10-5.el9_5

Steps to Reproduce

- name: mgmt_vrf | Create mgmt vrf
  community.general.nmcli:
    state: present
    type: vrf
    conn_name: vrf_mgmt
    table: 1001
    ifname: vrf_mgmt
    method4: disabled
    method6: disabled

Expected Results

No changes after the task ran once.

Actual Results

Each task run shows the following change:

TASK [network : mgmt_vrf | Create mgmt vrf] ******************************************************************************************************************************************************************************************************************
--- before
+++ after
@@ -9,5 +9,5 @@
     "ipv6.ignore-auto-dns": "no",
     "ipv6.ignore-auto-routes": "no",
     "ipv6.method": "disabled",
-    "table": null
+    "table": "1001"
 }

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions