diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/module_utils/network/vyos/facts/interfaces/interfaces.py | 9 | ||||
-rw-r--r-- | plugins/module_utils/network/vyos/utils/utils.py | 2 |
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): |