diff options
Diffstat (limited to 'plugins')
4 files changed, 16 insertions, 8 deletions
diff --git a/plugins/module_utils/network/vyos/argspec/firewall_rules/firewall_rules.py b/plugins/module_utils/network/vyos/argspec/firewall_rules/firewall_rules.py index 22dc8f7d..61d9a55a 100644 --- a/plugins/module_utils/network/vyos/argspec/firewall_rules/firewall_rules.py +++ b/plugins/module_utils/network/vyos/argspec/firewall_rules/firewall_rules.py @@ -87,7 +87,10 @@ class Firewall_rulesArgs(object): # pylint: disable=R0903 }, "type": "dict", }, - "disabled": {"type": "bool"}, + "disable": { + "type": "bool", + "aliases": ["disabled"], + }, "fragment": { "choices": [ "match-frag", diff --git a/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py b/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py index 22973bd7..2920878c 100644 --- a/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py +++ b/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py @@ -358,7 +358,7 @@ class Firewall_rules(ConfigBase): "number", "protocol", "fragment", - "disabled", + "disable", "description", "log", ) @@ -375,7 +375,7 @@ class Firewall_rules(ConfigBase): and key in l_set and not (h and self._is_w_same(w, h, key)) ): - if key == "disabled": + if key == "disable": if not ( not val and (not h or key not in h or not h[key]) @@ -398,7 +398,7 @@ class Firewall_rules(ConfigBase): ) continue if ( - key == "disabled" + key == "disable" and val and h and (key not in h or not h[key]) @@ -924,7 +924,7 @@ class Firewall_rules(ConfigBase): value and opr and attrib != "enable_default_log" - and attrib != "disabled" + and attrib != "disable" ): cmd += " '" + str(value) + "'" return cmd @@ -1033,7 +1033,7 @@ class Firewall_rules(ConfigBase): "action", "fragment", "protocol", - "disabled", + "disable", "description", "mac_address", "default_action", diff --git a/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py b/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py index f1c080f6..cb1d4bb8 100644 --- a/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py +++ b/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py @@ -168,7 +168,7 @@ class Firewall_rulesFacts(object): "action", "protocol", "fragment", - "disabled", + "disable", "description", "icmp", ] @@ -341,10 +341,14 @@ class Firewall_rulesFacts(object): config[attrib] = True else: out = search(r"^.*" + regex + " (.+)", conf, M) + if not out and attrib == "disable": + out = search(r"^.*\d+" + " ('disable'$)", conf, M) if out: val = out.group(1).strip("'") if self.is_num(attrib): val = int(val) + if attrib == "disable": + val = True config[attrib] = val return config diff --git a/plugins/modules/vyos_firewall_rules.py b/plugins/modules/vyos_firewall_rules.py index 6df6892c..aaef8a13 100644 --- a/plugins/modules/vyos_firewall_rules.py +++ b/plugins/modules/vyos_firewall_rules.py @@ -144,10 +144,11 @@ options: - The whole list can also be "negated" using '!'. - For example:'!22,telnet,http,123,1001-1005'. type: str - disabled: + disable: description: - Option to disable firewall rule. type: bool + aliases: ["disabled"] fragment: description: - IP fragment match. |