diff options
author | Wieger Bontekoe <wieger.bontekoe@gmail.com> | 2023-05-19 15:58:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-19 09:58:22 -0400 |
commit | 5138216f1e6e53cdeba69b28549a90278159bfaf (patch) | |
tree | c9b816b5cee911566b2e90ce00b807cbaefb6fb1 /plugins/module_utils/network | |
parent | a0267e790c9ba14f73cadb6fe77041946249402d (diff) | |
download | vyos-ansible-collection-5138216f1e6e53cdeba69b28549a90278159bfaf.tar.gz vyos-ansible-collection-5138216f1e6e53cdeba69b28549a90278159bfaf.zip |
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 <kcase@redhat.com>
Diffstat (limited to 'plugins/module_utils/network')
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 9fd00c1..51c3a10 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 ebfab03..845d79e 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 4d44744..d2ca703 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): |