From 5138216f1e6e53cdeba69b28549a90278159bfaf Mon Sep 17 00:00:00 2001 From: Wieger Bontekoe Date: Fri, 19 May 2023 15:58:22 +0200 Subject: Facts nw interfaces (#318) * Update l3_interfaces.py Fix for issue: https://github.com/ansible-collections/vyos.vyos/issues/295 * Added Changelog Fragment * Add support for Tunnel, Bridge and Dummy * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kate Case --- plugins/module_utils/network/vyos/facts/interfaces/interfaces.py | 2 +- .../module_utils/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(-) (limited to 'plugins') 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 @@ class InterfacesFacts(object): 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 @@ class L3_interfacesFacts(object): # 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): -- cgit v1.2.3