summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGomathiselviS <gomathiselvi@gmail.com>2020-10-08 12:09:25 -0400
committerGitHub <noreply@github.com>2020-10-08 16:09:25 +0000
commit9d5f8043ef86abb5584fb2b4cb2955e8df4501c1 (patch)
treeebba0ae38dbaaa891e19cea5f3bef0989996d2eb /plugins
parent053302db7217feadec96f30e65f15951082d98d5 (diff)
downloadvyos.vyos-9d5f8043ef86abb5584fb2b4cb2955e8df4501c1.tar.gz
vyos.vyos-9d5f8043ef86abb5584fb2b4cb2955e8df4501c1.zip
Support openvpn vtu interface (#86)
Support openvpn vtu interface Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'plugins')
-rw-r--r--plugins/module_utils/network/vyos/facts/interfaces/interfaces.py9
-rw-r--r--plugins/module_utils/network/vyos/utils/utils.py2
2 files changed, 9 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 358dd9d..13f22e1 100644
--- a/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py
+++ b/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py
@@ -42,6 +42,11 @@ class InterfacesFacts(object):
self.generated_spec = utils.generate_dict(facts_argument_spec)
+ def get_device_data(self, connection):
+
+ data = connection.get_config(flags=["| grep interfaces"])
+ return data
+
def populate_facts(self, connection, ansible_facts, data=None):
"""Populate the facts for interfaces
:param connection: the device connection
@@ -51,11 +56,11 @@ class InterfacesFacts(object):
:returns: facts
"""
if not data:
- data = connection.get_config(flags=["| grep interfaces"])
+ data = self.get_device_data(connection)
objs = []
interface_names = findall(
- r"^set interfaces (?:ethernet|bonding|vti|loopback|vxlan) (?:\'*)(\S+)(?:\'*)",
+ r"^set interfaces (?:ethernet|bonding|vti|loopback|vxlan|openvpn) (?:\'*)(\S+)(?:\'*)",
data,
M,
)
diff --git a/plugins/module_utils/network/vyos/utils/utils.py b/plugins/module_utils/network/vyos/utils/utils.py
index bcf6fc2..7ce4688 100644
--- a/plugins/module_utils/network/vyos/utils/utils.py
+++ b/plugins/module_utils/network/vyos/utils/utils.py
@@ -31,6 +31,8 @@ def get_interface_type(interface):
return "vti"
elif interface.startswith("lo"):
return "loopback"
+ elif interface.startswith("vtun"):
+ return "openvpn"
def dict_delete(base, comparable):