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 | |
parent | a0267e790c9ba14f73cadb6fe77041946249402d (diff) | |
download | vyos.vyos-5138216f1e6e53cdeba69b28549a90278159bfaf.tar.gz vyos.vyos-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>
5 files changed, 12 insertions, 3 deletions
diff --git a/changelogs/fragments/l3_interfaces-support.yaml b/changelogs/fragments/l3_interfaces-support.yaml new file mode 100644 index 0000000..41bcd07 --- /dev/null +++ b/changelogs/fragments/l3_interfaces-support.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - vyos-l3_interface_support - Add support for Tunnel, Bridge and Dummy interfaces. (https://github.com/ansible-collections/vyos.vyos/issues/265) @@ -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 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): |