From 760b1e2cad75fdbaeae9e891f9f7e8379aadefb4 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:38:18 +0200 Subject: [PATCH] nmcli: allow IPv4/IPv6 configuration on ipip and sit devices (#3239) (#3254) * 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 (cherry picked from commit 1ca9c350109966f7f901f447b7b9c483bd5006cf) Co-authored-by: zerotens --- .../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 af5c0c7898..387b0ff405 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -811,6 +811,8 @@ class Nmcli(object): 'ethernet', 'generic', 'infiniband', + 'ipip', + 'sit', 'team', 'vlan', ) diff --git a/tests/unit/plugins/modules/net_tools/test_nmcli.py b/tests/unit/plugins/modules/net_tools/test_nmcli.py index 7c39cfd62c..39c9f188ea 100644 --- a/tests/unit/plugins/modules/net_tools/test_nmcli.py +++ b/tests/unit/plugins/modules/net_tools/test_nmcli.py @@ -340,6 +340,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 @@ -363,6 +369,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