From a98cd157a34aca418e4cc48628686945a05fa3ba Mon Sep 17 00:00:00 2001 From: archelon Date: Thu, 12 Dec 2024 09:55:39 +0300 Subject: [PATCH 1/2] Add OG service support --- plugins/module_utils/network/ios/argspec/acls/acls.py | 1 + plugins/module_utils/network/ios/rm_templates/acls.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/plugins/module_utils/network/ios/argspec/acls/acls.py b/plugins/module_utils/network/ios/argspec/acls/acls.py index 605dc5ac7..6d7032891 100644 --- a/plugins/module_utils/network/ios/argspec/acls/acls.py +++ b/plugins/module_utils/network/ios/argspec/acls/acls.py @@ -216,6 +216,7 @@ class AclsArgs(object): # pylint: disable=R0903 }, "remarks": {"elements": "str", "type": "list"}, "sequence": {"type": "int"}, + "service_object_group": {"type": "str"}, "source": { "options": { "address": {"type": "str"}, diff --git a/plugins/module_utils/network/ios/rm_templates/acls.py b/plugins/module_utils/network/ios/rm_templates/acls.py index 642128311..327f12ed5 100644 --- a/plugins/module_utils/network/ios/rm_templates/acls.py +++ b/plugins/module_utils/network/ios/rm_templates/acls.py @@ -78,6 +78,7 @@ def source_destination_common_config(config_data, command, attr): ) elif aces.get("protocol"): command += " {protocol}".format(**aces) + if aces.get("service_object_group"): command += " object-group {service_object_group}".format(**aces) if aces.get("source"): command = source_destination_common_config(aces, command, "source") if aces.get("destination"): @@ -287,6 +288,7 @@ def __init__(self, lines=None): (\sevaluate\s(?P\S+))? (\s(?P\d+)\s)? (\s*(?Pahp|eigrp|esp|gre|icmp|igmp|ipinip|ipv6|ip|nos|ospf|pcp|pim|sctp|tcp|ip|udp))? + (\sobject-group\s(?P\S+))? ((\s*(?Pany))| (\s*object-group\s(?P\S+))| (\s*host\s(?P\S+))| @@ -340,6 +342,7 @@ def __init__(self, lines=None): "protocol": "{{ protocol }}", "protocol_number": "{{ protocol_num }}", "icmp_igmp_tcp_protocol": "{{ icmp_igmp_tcp_protocol }}", + "service_object_group": "{{ service_obj_grp }}", "source": { "address": "{{ source_address }}", "ipv6_address": "{{ ipv6_source_address }}", From 181f02e3f0cb253753c19e01e114cdefcfd28399 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:21:05 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- plugins/module_utils/network/ios/rm_templates/acls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/network/ios/rm_templates/acls.py b/plugins/module_utils/network/ios/rm_templates/acls.py index 327f12ed5..80cb19656 100644 --- a/plugins/module_utils/network/ios/rm_templates/acls.py +++ b/plugins/module_utils/network/ios/rm_templates/acls.py @@ -78,7 +78,8 @@ def source_destination_common_config(config_data, command, attr): ) elif aces.get("protocol"): command += " {protocol}".format(**aces) - if aces.get("service_object_group"): command += " object-group {service_object_group}".format(**aces) + if aces.get("service_object_group"): + command += " object-group {service_object_group}".format(**aces) if aces.get("source"): command = source_destination_common_config(aces, command, "source") if aces.get("destination"):