From 1ca9c350109966f7f901f447b7b9c483bd5006cf Mon Sep 17 00:00:00 2001 From: zerotens Date: Mon, 23 Aug 2021 06:24:05 +0200 Subject: [PATCH] nmcli: allow IPv4/IPv6 configuration on ipip and sit devices (#3239) * Allow IPv4/IPv6 configuration on mode "sit" tunnel devices * Update Unit Test for Allow IPv4/IPv6 configuration on mode "sit" tunnel devices * Add changelog for Allow IPv4/IPv6 configuration on mode "sit" tunnel devices * Update changelogs/fragments/3239-nmcli-sit-ip-config-bugfix.yaml Co-authored-by: Ajpantuso * Added ip4/ip6 configuration arguments for ipip tunnels Co-authored-by: Ajpantuso --- .../fragments/3239-nmcli-sit-ipip-config-bugfix.yaml | 2 ++ plugins/modules/net_tools/nmcli.py | 2 ++ tests/unit/plugins/modules/net_tools/test_nmcli.py | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 changelogs/fragments/3239-nmcli-sit-ipip-config-bugfix.yaml diff --git a/changelogs/fragments/3239-nmcli-sit-ipip-config-bugfix.yaml b/changelogs/fragments/3239-nmcli-sit-ipip-config-bugfix.yaml new file mode 100644 index 0000000000..78a172342e --- /dev/null +++ b/changelogs/fragments/3239-nmcli-sit-ipip-config-bugfix.yaml @@ -0,0 +1,2 @@ +bugfixes: + - "nmcli - added ip4/ip6 configuration arguments for ``sit`` and ``ipip`` tunnels (https://github.com/ansible-collections/community.general/issues/3238, https://github.com/ansible-collections/community.general/pull/3239)." diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py index 0a7d78b681..cce9e44ee4 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -1248,6 +1248,8 @@ class Nmcli(object): 'ethernet', 'generic', 'infiniband', + 'ipip', + 'sit', 'team', 'vlan', 'wifi' diff --git a/tests/unit/plugins/modules/net_tools/test_nmcli.py b/tests/unit/plugins/modules/net_tools/test_nmcli.py index ca83044201..f81b636a81 100644 --- a/tests/unit/plugins/modules/net_tools/test_nmcli.py +++ b/tests/unit/plugins/modules/net_tools/test_nmcli.py @@ -388,6 +388,12 @@ TESTCASE_IPIP_SHOW_OUTPUT = """\ connection.id: non_existent_nw_device connection.interface-name: ipip-existent_nw_device connection.autoconnect: yes +ipv4.ignore-auto-dns: no +ipv4.ignore-auto-routes: no +ipv4.never-default: no +ipv4.may-fail: yes +ipv6.ignore-auto-dns: no +ipv6.ignore-auto-routes: no ip-tunnel.mode: ipip ip-tunnel.parent: non_existent_ipip_device ip-tunnel.local: 192.168.225.5 @@ -411,6 +417,12 @@ TESTCASE_SIT_SHOW_OUTPUT = """\ connection.id: non_existent_nw_device connection.interface-name: sit-existent_nw_device connection.autoconnect: yes +ipv4.ignore-auto-dns: no +ipv4.ignore-auto-routes: no +ipv4.never-default: no +ipv4.may-fail: yes +ipv6.ignore-auto-dns: no +ipv6.ignore-auto-routes: no ip-tunnel.mode: sit ip-tunnel.parent: non_existent_sit_device ip-tunnel.local: 192.168.225.5