summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/module_utils/network/vyos/argspec/bgp_global/bgp_global.py2
-rw-r--r--plugins/module_utils/network/vyos/argspec/ospf_interfaces/ospf_interfaces.py12
-rw-r--r--plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py10
-rw-r--r--plugins/module_utils/network/vyos/facts/bgp_global/bgp_global.py8
-rw-r--r--plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py11
-rw-r--r--plugins/module_utils/network/vyos/rm_templates/bgp_address_family.py4
-rw-r--r--plugins/module_utils/network/vyos/rm_templates/bgp_global.py4
-rw-r--r--plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py4
8 files changed, 38 insertions, 17 deletions
diff --git a/plugins/module_utils/network/vyos/argspec/bgp_global/bgp_global.py b/plugins/module_utils/network/vyos/argspec/bgp_global/bgp_global.py
index 4192a84..da56aa9 100644
--- a/plugins/module_utils/network/vyos/argspec/bgp_global/bgp_global.py
+++ b/plugins/module_utils/network/vyos/argspec/bgp_global/bgp_global.py
@@ -174,7 +174,7 @@ class Bgp_globalArgs(object): # pylint: disable=R0903
},
"disable_connected_check": {"type": "bool"},
"address": {"type": "str"},
- "password": {"type": "str"},
+ "password": {"type": "str", "no_log": True},
"disable_send_community": {
"type": "str",
"choices": ["extended", "standard"],
diff --git a/plugins/module_utils/network/vyos/argspec/ospf_interfaces/ospf_interfaces.py b/plugins/module_utils/network/vyos/argspec/ospf_interfaces/ospf_interfaces.py
index e7dd10c..71ba63b 100644
--- a/plugins/module_utils/network/vyos/argspec/ospf_interfaces/ospf_interfaces.py
+++ b/plugins/module_utils/network/vyos/argspec/ospf_interfaces/ospf_interfaces.py
@@ -71,12 +71,18 @@ class Ospf_interfacesArgs(object): # pylint: disable=R0903
"authentication": {
"type": "dict",
"options": {
- "plaintext_password": {"type": "str"},
+ "plaintext_password": {
+ "type": "str",
+ "no_log": True,
+ },
"md5_key": {
"type": "dict",
+ "no_log": False,
"options": {
- "key_id": {"type": "int"},
- "key": {"type": "str"},
+ "key_id": {
+ "type": "int",
+ },
+ "key": {"type": "str", "no_log": True},
},
},
},
diff --git a/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py b/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py
index b8e915c..0061e79 100644
--- a/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py
+++ b/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py
@@ -174,11 +174,17 @@ class Ospfv2Args(object): # pylint: disable=R0903
"elements": "dict",
"options": {
"key_id": {"type": "int"},
- "md5_key": {"type": "str"},
+ "md5_key": {
+ "type": "str",
+ "no_log": True,
+ },
},
"type": "list",
},
- "plaintext_password": {"type": "str"},
+ "plaintext_password": {
+ "type": "str",
+ "no_log": True,
+ },
},
"type": "dict",
},
diff --git a/plugins/module_utils/network/vyos/facts/bgp_global/bgp_global.py b/plugins/module_utils/network/vyos/facts/bgp_global/bgp_global.py
index 3cfa83c..1efd877 100644
--- a/plugins/module_utils/network/vyos/facts/bgp_global/bgp_global.py
+++ b/plugins/module_utils/network/vyos/facts/bgp_global/bgp_global.py
@@ -59,7 +59,9 @@ class Bgp_globalFacts(object):
if "address-family" not in resource:
config_lines.append(re.sub("'", "", resource))
- bgp_global_parser = Bgp_globalTemplate(lines=config_lines)
+ bgp_global_parser = Bgp_globalTemplate(
+ lines=config_lines, module=self._module
+ )
objs = bgp_global_parser.parse()
if "neighbor" in objs:
@@ -79,7 +81,9 @@ class Bgp_globalFacts(object):
ansible_facts["ansible_network_resources"].pop("bgp_global", None)
params = utils.remove_empties(
- utils.validate_config(self.argument_spec, {"config": objs})
+ bgp_global_parser.validate_config(
+ self.argument_spec, {"config": objs}, redact=True
+ )
)
facts["bgp_global"] = params.get("config", [])
diff --git a/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py b/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py
index 15ac92a..7ef05cb 100644
--- a/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py
+++ b/plugins/module_utils/network/vyos/facts/ospf_interfaces/ospf_interfaces.py
@@ -69,6 +69,9 @@ class Ospf_interfacesFacts(object):
"""
facts = {}
objs = []
+ ospf_interfaces_parser = Ospf_interfacesTemplate(
+ lines=[], module=self._module
+ )
if not data:
data = self.get_device_data(connection)
@@ -78,7 +81,7 @@ class Ospf_interfacesFacts(object):
resources = self.get_config_set(data)
for resource in resources:
ospf_interfaces_parser = Ospf_interfacesTemplate(
- lines=resource.split("\n")
+ lines=resource.split("\n"), module=self._module
)
objs = ospf_interfaces_parser.parse()
for key, sortv in [("address_family", "afi")]:
@@ -89,8 +92,10 @@ class Ospf_interfacesFacts(object):
ansible_facts["ansible_network_resources"].pop("ospf_interfaces", None)
facts = {"ospf_interfaces": []}
params = utils.remove_empties(
- utils.validate_config(
- self.argument_spec, {"config": ospf_interfaces_facts}
+ ospf_interfaces_parser.validate_config(
+ self.argument_spec,
+ {"config": ospf_interfaces_facts},
+ redact=True,
)
)
if params.get("config"):
diff --git a/plugins/module_utils/network/vyos/rm_templates/bgp_address_family.py b/plugins/module_utils/network/vyos/rm_templates/bgp_address_family.py
index 55e2200..ae953e4 100644
--- a/plugins/module_utils/network/vyos/rm_templates/bgp_address_family.py
+++ b/plugins/module_utils/network/vyos/rm_templates/bgp_address_family.py
@@ -282,10 +282,10 @@ def _tmplt_bgp_af_neighbor(config_data):
class Bgp_address_familyTemplate(NetworkTemplate):
- def __init__(self, lines=None):
+ def __init__(self, lines=None, module=None):
prefix = {"set": "set", "remove": "delete"}
super(Bgp_address_familyTemplate, self).__init__(
- lines=lines, tmplt=self, prefix=prefix
+ lines=lines, tmplt=self, prefix=prefix, module=module
)
# fmt: off
diff --git a/plugins/module_utils/network/vyos/rm_templates/bgp_global.py b/plugins/module_utils/network/vyos/rm_templates/bgp_global.py
index aff6258..cb9907b 100644
--- a/plugins/module_utils/network/vyos/rm_templates/bgp_global.py
+++ b/plugins/module_utils/network/vyos/rm_templates/bgp_global.py
@@ -218,10 +218,10 @@ def _tmplt_bgp_params_distance(config_data):
class Bgp_globalTemplate(NetworkTemplate):
- def __init__(self, lines=None):
+ def __init__(self, lines=None, module=None):
prefix = {"set": "set", "remove": "delete"}
super(Bgp_globalTemplate, self).__init__(
- lines=lines, tmplt=self, prefix=prefix
+ lines=lines, tmplt=self, prefix=prefix, module=module
)
# fmt: off
diff --git a/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py b/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py
index 460e6b0..1e3afbe 100644
--- a/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py
+++ b/plugins/module_utils/network/vyos/rm_templates/ospf_interfaces.py
@@ -302,10 +302,10 @@ def _tmplt_ospf_int_passive(config_data):
class Ospf_interfacesTemplate(NetworkTemplate):
- def __init__(self, lines=None):
+ def __init__(self, lines=None, module=None):
prefix = {"set": "set", "remove": "delete"}
super(Ospf_interfacesTemplate, self).__init__(
- lines=lines, tmplt=self, prefix=prefix
+ lines=lines, tmplt=self, prefix=prefix, module=module
)
# fmt: off