From 5511ae66f2bf26a7e077b3c03e5578c26b097c5d Mon Sep 17 00:00:00 2001 From: Wieger Bontekoe Date: Thu, 13 Apr 2023 11:05:44 +0200 Subject: [PATCH 01/10] Update l3_interfaces.py Fix for issue: https://github.com/ansible-collections/vyos.vyos/issues/295 --- .../network/vyos/facts/l3_interfaces/l3_interfaces.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py index ea4cf69b..0afa7ff5 100644 --- a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py @@ -126,6 +126,8 @@ def parse_attribs(self, conf): config["ipv4"].append({"address": item}) elif item == "dhcpv6": config["ipv6"].append({"address": item}) + elif item == "no-default-link-local": + config["ipv6"].append({"address": item}) else: ip_version = get_ip_address_version(item.split("/")[0]) if ip_version == 4: From 4eea247691b4f59d323687622157bcc44a0deaab Mon Sep 17 00:00:00 2001 From: CharlieRoot Date: Wed, 26 Apr 2023 08:46:35 +0200 Subject: [PATCH 02/10] Added Changelog Fragment --- changelogs/fragments/l3_interfaces.yaml | 3 +++ .../network/vyos/facts/l3_interfaces/l3_interfaces.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/l3_interfaces.yaml diff --git a/changelogs/fragments/l3_interfaces.yaml b/changelogs/fragments/l3_interfaces.yaml new file mode 100644 index 00000000..09c88263 --- /dev/null +++ b/changelogs/fragments/l3_interfaces.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - vyos-l3_interface_facts - fixed #295 - error when using no-default-link-local option. diff --git a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py index 0afa7ff5..ebfab030 100644 --- a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py @@ -128,6 +128,8 @@ def parse_attribs(self, conf): config["ipv6"].append({"address": item}) elif item == "no-default-link-local": config["ipv6"].append({"address": item}) + elif item == "autoconf": + config["ipv6"].append({"address": item}) else: ip_version = get_ip_address_version(item.split("/")[0]) if ip_version == 4: From 5ddd8a861d5dbb69b89c58c026d7640e34d39461 Mon Sep 17 00:00:00 2001 From: CharlieRoot Date: Wed, 26 Apr 2023 08:57:58 +0200 Subject: [PATCH 03/10] Add support for Tunnel, Bridge and Dummy --- .../network/vyos/facts/interfaces/interfaces.py | 2 +- .../network/vyos/facts/l3_interfaces/l3_interfaces.py | 2 +- plugins/module_utils/network/vyos/utils/utils.py | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py b/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py index 9fd00c1e..51c3a10a 100644 --- a/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py +++ b/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py @@ -59,7 +59,7 @@ def populate_facts(self, connection, ansible_facts, data=None): objs = [] interface_names = findall( - r"^set interfaces (?:ethernet|bonding|vti|loopback|vxlan|openvpn|wireguard) (?:\'*)(\S+)(?:\'*)", + r"^set interfaces (?:ethernet|bonding|bridge|dummy|tunnel|vti|loopback|vxlan|openvpn|wireguard) (?:\'*)(\S+)(?:\'*)", data, M, ) diff --git a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py index ebfab030..845d79e7 100644 --- a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py @@ -60,7 +60,7 @@ def populate_facts(self, connection, ansible_facts, data=None): # operate on a collection of resource x objs = [] interface_names = re.findall( - r"set interfaces (?:ethernet|bonding|vti|vxlan) (?:\'*)(\S+)(?:\'*)", + r"set interfaces (?:ethernet|bonding|bridge|dummy|tunnel|vti|vxlan) (?:\'*)(\S+)(?:\'*)", data, re.M, ) diff --git a/plugins/module_utils/network/vyos/utils/utils.py b/plugins/module_utils/network/vyos/utils/utils.py index 4d447448..d2ca7038 100644 --- a/plugins/module_utils/network/vyos/utils/utils.py +++ b/plugins/module_utils/network/vyos/utils/utils.py @@ -40,6 +40,12 @@ def get_interface_type(interface): return "openvpn" elif interface.startswith("wg"): return "wireguard" + elif interface.startswith("tun"): + return "tunnel" + elif interface.startswith("br"): + return "bridge" + elif interface.startswith("dum"): + return "dummy" def dict_delete(base, comparable): From 5f51660e334a5cf0a834730c8810369e6e99adf6 Mon Sep 17 00:00:00 2001 From: CharlieRoot Date: Wed, 26 Apr 2023 08:58:36 +0200 Subject: [PATCH 04/10] Added Change Fragment --- changelogs/fragments/l3_interfaces.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/changelogs/fragments/l3_interfaces.yaml b/changelogs/fragments/l3_interfaces.yaml index 09c88263..b3ce1019 100644 --- a/changelogs/fragments/l3_interfaces.yaml +++ b/changelogs/fragments/l3_interfaces.yaml @@ -1,3 +1,4 @@ --- trivial: - vyos-l3_interface_facts - fixed #295 - error when using no-default-link-local option. + - vyos-l3_interface_facts - fAdd support for Tunnel, Bridge and Dummy interfaces From 6111d77ded614cd6e63d61896770667064f1b94e Mon Sep 17 00:00:00 2001 From: CharlieRoot Date: Wed, 26 Apr 2023 09:00:05 +0200 Subject: [PATCH 05/10] Removed old data --- changelogs/fragments/l3_interfaces.yaml | 1 - .../network/vyos/facts/l3_interfaces/l3_interfaces.py | 4 ---- 2 files changed, 5 deletions(-) diff --git a/changelogs/fragments/l3_interfaces.yaml b/changelogs/fragments/l3_interfaces.yaml index b3ce1019..647a7ab7 100644 --- a/changelogs/fragments/l3_interfaces.yaml +++ b/changelogs/fragments/l3_interfaces.yaml @@ -1,4 +1,3 @@ --- trivial: - - vyos-l3_interface_facts - fixed #295 - error when using no-default-link-local option. - vyos-l3_interface_facts - fAdd support for Tunnel, Bridge and Dummy interfaces diff --git a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py index 845d79e7..aac9b41c 100644 --- a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py @@ -126,10 +126,6 @@ def parse_attribs(self, conf): config["ipv4"].append({"address": item}) elif item == "dhcpv6": config["ipv6"].append({"address": item}) - elif item == "no-default-link-local": - config["ipv6"].append({"address": item}) - elif item == "autoconf": - config["ipv6"].append({"address": item}) else: ip_version = get_ip_address_version(item.split("/")[0]) if ip_version == 4: From 2ae1949a35476ee7d7cf8a48743c63015fb975a1 Mon Sep 17 00:00:00 2001 From: CharlieRoot Date: Wed, 26 Apr 2023 09:00:06 +0200 Subject: [PATCH 06/10] Removed old data --- changelogs/fragments/l3_interfaces.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/l3_interfaces.yaml b/changelogs/fragments/l3_interfaces.yaml index 647a7ab7..29248c27 100644 --- a/changelogs/fragments/l3_interfaces.yaml +++ b/changelogs/fragments/l3_interfaces.yaml @@ -1,3 +1,3 @@ --- trivial: - - vyos-l3_interface_facts - fAdd support for Tunnel, Bridge and Dummy interfaces + - vyos-l3_interface_facts - Add support for Tunnel, Bridge and Dummy interfaces From c9efb1099d35679f0ec8e5f05e572b643b86e1d0 Mon Sep 17 00:00:00 2001 From: Wieger Bontekoe Date: Mon, 1 May 2023 12:05:50 +0200 Subject: [PATCH 07/10] Update changelogs/fragments/l3_interfaces.yaml Co-authored-by: Kate Case --- changelogs/fragments/l3_interfaces.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelogs/fragments/l3_interfaces.yaml b/changelogs/fragments/l3_interfaces.yaml index 29248c27..48f95093 100644 --- a/changelogs/fragments/l3_interfaces.yaml +++ b/changelogs/fragments/l3_interfaces.yaml @@ -1,3 +1,3 @@ --- -trivial: - - vyos-l3_interface_facts - Add support for Tunnel, Bridge and Dummy interfaces +minor_changes: + - vyos-l3_interface_facts - Add support for Tunnel, Bridge and Dummy interfaces. (https://github.com/ansible-collections/vyos.vyos/issues/265) From fa6abb683d7f3972210a616c45aa33e89eb46cb7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 10:06:05 +0000 Subject: [PATCH 08/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index fb02e073..d2d6ce3d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -11,4 +11,4 @@ readme: README.md repository: https://github.com/ansible-collections/vyos.vyos issues: https://github.com/ansible-collections/vyos.vyos/issues tags: [vyos, networking] -version: 4.0.3-dev +version: 4.1.0-dev From 52f8fe59f3645da502e743c23e206dc2c30e5753 Mon Sep 17 00:00:00 2001 From: Wieger Bontekoe Date: Wed, 10 May 2023 06:47:00 +0200 Subject: [PATCH 09/10] Rename l3_interfaces.yaml to l3_interfaces-support.yaml --- .../fragments/{l3_interfaces.yaml => l3_interfaces-support.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelogs/fragments/{l3_interfaces.yaml => l3_interfaces-support.yaml} (100%) diff --git a/changelogs/fragments/l3_interfaces.yaml b/changelogs/fragments/l3_interfaces-support.yaml similarity index 100% rename from changelogs/fragments/l3_interfaces.yaml rename to changelogs/fragments/l3_interfaces-support.yaml From f6dc89da95318d176cf990ec5cf646fa1bcd01ea Mon Sep 17 00:00:00 2001 From: Wieger Bontekoe Date: Wed, 10 May 2023 06:47:32 +0200 Subject: [PATCH 10/10] Update l3_interfaces-support.yaml --- changelogs/fragments/l3_interfaces-support.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/l3_interfaces-support.yaml b/changelogs/fragments/l3_interfaces-support.yaml index 48f95093..41bcd07b 100644 --- a/changelogs/fragments/l3_interfaces-support.yaml +++ b/changelogs/fragments/l3_interfaces-support.yaml @@ -1,3 +1,3 @@ --- minor_changes: - - vyos-l3_interface_facts - Add support for Tunnel, Bridge and Dummy interfaces. (https://github.com/ansible-collections/vyos.vyos/issues/265) + - vyos-l3_interface_support - Add support for Tunnel, Bridge and Dummy interfaces. (https://github.com/ansible-collections/vyos.vyos/issues/265)