From a159934295df1c129ea6da3ee4f47de5c5c21e3f Mon Sep 17 00:00:00 2001 From: KB-perByte Date: Mon, 18 Sep 2023 14:53:34 +0530 Subject: [PATCH 01/22] acls fixes --- .../network/ios/rm_templates/acls.py | 57 +++++++++++-------- plugins/modules/ios_command.py | 2 +- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/plugins/module_utils/network/ios/rm_templates/acls.py b/plugins/module_utils/network/ios/rm_templates/acls.py index 164c93caf..bafc76dbd 100644 --- a/plugins/module_utils/network/ios/rm_templates/acls.py +++ b/plugins/module_utils/network/ios/rm_templates/acls.py @@ -149,7 +149,7 @@ def __init__(self, lines=None): r"""^(ip|ipv6) (\s(access-list)) (\s(standard|extended)) - (\s(?P\S+))? + (\s(?P\S+)) $""", re.VERBOSE, ), @@ -159,13 +159,12 @@ def __init__(self, lines=None): "shared": True, }, { - "name": "_mac_acls_name", # + "name": "_mac_acls_name", # mac acls to be removed "getval": re.compile( - r"""^(?PStandard|Extended|Reflexive)* - \s*(?PMAC)* - \s*access - \s*list* - \s*(?P.+)* + r"""^(?PStandard|Extended|Reflexive) + (\s(?PMAC)) + (\s(access-list)) + (\s(?P.+)) $""", re.VERBOSE, ), @@ -204,8 +203,8 @@ def __init__(self, lines=None): "name": "remarks_type_linear", "getval": re.compile( r"""^(access-list) - (\s(?P\S+))? - (\sremark\s(?P.+))? + (\s(?P\S+)) + (\sremark\s(?P.+)) $""", re.VERBOSE, ), @@ -224,7 +223,7 @@ def __init__(self, lines=None): "getval": re.compile( r"""\s*(?P\d+)* \s(?Pdeny|permit)? - (\s+(?P
(?!ahp|eigrp|esp|gre|icmp|igmp|ipv6|ipinip|ip|nos|object-group|ospf|pcp|pim|sctp|tcp|udp)\S+|\S+,))? + (\s+(?P
(?!ahp|any|eigrp|esp|gre|icmp|igmp|ipv6|ipinip|ip|nos|object-group|ospf|pcp|pim|sctp|tcp|udp)\S+|\S+,))? (\s*(?Pany))? (\swildcard\sbits\s(?P\S+))? (\shost\s(?P\S+))? @@ -261,24 +260,32 @@ def __init__(self, lines=None): (\s*(?Pdeny|permit)) (\sevaluate\s(?P\S+))? (\s(?P\d+))? - (\s(?Pahp|eigrp|esp|gre|icmp|igmp|ipv6|ipinip|ip|nos|ospf|pcp|pim|sctp|tcp|udp))? + (\s(?Pahp|eigrp|any|esp|gre|icmp|igmp|ipv6|ipinip|ip|nos|ospf|pcp|pim|sctp|tcp|udp))? ((\s(?Pany))| (\sobject-group\s(?P\S+))| (\shost\s(?P\S+))| (\s(?P(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})\s\S+)))? - (\s(?P(eq|gts|gt|lt|neq)\s(\S+|\d+)))? + (\seq\s(?P(\S+|\d+)))? + (\sgt\s(?P(\S+|\d+)))? + (\slt\s(?P(\S+|\d+)))? + (\sneq\s(?P(\S+|\d+)))? (\srange\s(?P\d+)\s(?P\d+))? (\s(?Pany))? (\sobject-group\s(?P\S+))? (\shost\s(?P\S+))? (\s(?P(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})\s\S+))? - (\s(?P(eq|gts|lt|neq)\s(\S+|\d+)))? + (\seq\s(?P(\S+|\d+)))? + (\sgt\s(?P(\S+|\d+)))? + (\slt\s(?P(\S+|\d+)))? + (\sneq\s(?P(\S+|\d+)))? (\srange\s(?P\d+)\s(?P\d+))? (\s(?Padministratively-prohibited|alternate-address|conversion-error|dod-host-prohibited|dod-net-prohibited|echo-reply|echo|general-parameter-problem|host-isolated|host-precedence-unreachable|host-redirect|host-tos-redirect|host-tos-unreachable|host-unknown|host-unreachable|information-reply|information-request|mask-reply|mask-request|mobile-redirect|net-redirect|net-tos-redirect|net-tos-unreachable|net-unreachable|network-unknown|no-room-for-option|option-missing|packet-too-big|parameter-problem|port-unreachable|precedence-unreachable|protocol-unreachable|reassembly-timeout|redirect|router-advertisement|router-solicitation|source-quench|source-route-failed|time-exceeded|timestamp-reply|timestamp-request|traceroute|ttl-exceeded|unreachable|dvmrp|host-query|mtrace-resp|mtrace-route|pim|trace|v1host-report|v2host-report|v2leave-group|v3host-report|ack|established|fin|psh|rst|syn|urg))? (\sdscp\s(?P\S+))? (\s(?Pfragments))? - (\s(?Plog-input\s\(tag\s=\s\S+\)|log-input))? - (\s(?Plog\s\(tag\s=\s\S+\)|log))? + (\slog-input\s\(tag\s=\s(?P\S+\)|log-input))? + (\s(?Plog-input))? + (\slog\s\(tag\s=\s(?P\S+\)|log))? + (\s(?Plog))? (\soption\s(?P