From 1554f23bfbc5fb59fb04a1b5ab97224ddb7ace3f Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Tue, 10 Mar 2026 21:42:37 +0100 Subject: [PATCH] nmcli: fix idempotency issue with macvlan (#11551) * nmcli: fix idempotency issue with macvlan The nmcli module is not idempotent for macvlan interfaces. Ansible running in diff mode for a case where the interface in question already exists: ``` TASK [nm_macvlan : Check macvlan connection] ********************************************************************************* --- before +++ after @@ -11,5 +11,5 @@ "ipv6.method": "disabled", "macvlan.mode": "2", "macvlan.parent": "eth0", - "macvlan.tap": "no" + "macvlan.tap": "False" } ``` The problem is that `macvlan.tap` isn't treated as boolean option. Fix it. * Update changelogs/fragments/11551-fix-nmcli-idempotency-for-macvlan.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- .../fragments/11551-fix-nmcli-idempotency-for-macvlan.yml | 4 ++++ plugins/modules/nmcli.py | 1 + 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/11551-fix-nmcli-idempotency-for-macvlan.yml diff --git a/changelogs/fragments/11551-fix-nmcli-idempotency-for-macvlan.yml b/changelogs/fragments/11551-fix-nmcli-idempotency-for-macvlan.yml new file mode 100644 index 0000000000..f14a88d5d9 --- /dev/null +++ b/changelogs/fragments/11551-fix-nmcli-idempotency-for-macvlan.yml @@ -0,0 +1,4 @@ +--- +minor_changes: + - nmcli - fix idempotency for MAC VLAN interfaces when using ``macvlan.tap`` + (https://github.com/ansible-collections/community.general/pull/11551). diff --git a/plugins/modules/nmcli.py b/plugins/modules/nmcli.py index 09d06d4aca..0dfc796681 100644 --- a/plugins/modules/nmcli.py +++ b/plugins/modules/nmcli.py @@ -2357,6 +2357,7 @@ class Nmcli: "ipv6.ignore-auto-routes", "802-11-wireless.hidden", "team.runner-fast-rate", + "macvlan.tap", }: return bool elif setting in {