diff --git a/plugins/modules/aci_context_policy.py b/plugins/modules/aci_context_policy.py index aa35081b8..5c7c71513 100644 --- a/plugins/modules/aci_context_policy.py +++ b/plugins/modules/aci_context_policy.py @@ -12,10 +12,10 @@ DOCUMENTATION = r""" --- -module: aci_route_control_profile -short_description: Manage Context Policy (rtcrtl:CtxP) +module: aci_context_policy +short_description: Manage Route Context Policy (rtcrtl:CtxP) description: -- Manage Context Policies for the Route Control Profiles on Cisco ACI fabrics. +- Manage Route Context Policies for the Route Control Profiles on Cisco ACI fabrics. options: tenant: description: @@ -42,6 +42,20 @@ - The action required when the condition is met. type: str choices: [ deny, permit ] + action_rule: + description: + - Name of the action rule profile to be associated with this route context policy. + - Set the rules for a Route Map. + - See module M(cisco.aci.aci_tenant_action_rule_profile). + type: str + aliases: [ action_rule_name ] + subject_profile: + description: + - Name of the subject profile to be associated with this route context policy. + - Set the associated Matched rules. + - See module M(cisco.aci.aci_subject_profile). + type: str + aliases: [ subject_name ] order: description: - The order of the policy context. @@ -199,11 +213,11 @@ def main(): argument_spec.update( tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects l3out=dict(type="str", aliases=["l3out_name"]), # Not required for querying all objects - route_control_profile=dict(type="str", aliases=["rtctrl_profile_name"]), # Not required for querying all objects - context_policy=dict(type="str", aliases=["name", "context_name"]), # Not required for querying all objects + route_control_profile=dict(type="str", aliases=["rtctrl_profile_name"]), # Not required for querying all objects + context_policy=dict(type="str", aliases=["name", "context_name"]), # Not required for querying all objects subject_profile=dict(type="str", aliases=["subject_name"]), action_rule=dict(type="str", aliases=["action_rule_name"]), - action = dict(type="str", choices=["deny", "permit"]), + action=dict(type="str", choices=["deny", "permit"]), order=dict(type="int"), description=dict(type="str", aliases=["descr"]), name_alias=dict(type="str"), @@ -236,26 +250,26 @@ def main(): child_classes = ["rtctrlRsCtxPToSubjP", "rtctrlScope"] tenant_url_config = dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ) - + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ) + route_control_profile_url_config = dict( - aci_class="rtctrlProfile", - aci_rn="prof-{0}".format(route_control_profile), - module_object=route_control_profile, - target_filter={"name": route_control_profile}, - ) - + aci_class="rtctrlProfile", + aci_rn="prof-{0}".format(route_control_profile), + module_object=route_control_profile, + target_filter={"name": route_control_profile}, + ) + context_policy_url_config = dict( - aci_class="rtctrlCtxP", - aci_rn="ctx-{0}".format(context_policy), - module_object=context_policy, - target_filter={"name": context_policy}, - ) - + aci_class="rtctrlCtxP", + aci_rn="ctx-{0}".format(context_policy), + module_object=context_policy, + target_filter={"name": context_policy}, + ) + if l3out is not None: aci.construct_url( root_class=tenant_url_config, @@ -285,9 +299,11 @@ def main(): child_configs.append({"rtctrlRsCtxPToSubjP": {"attributes": {"tnRtctrlSubjPName": subject_profile}}}) if action_rule is not None: child_configs.append( - {"rtctrlScope": {"attributes": {"descr": ""}, - "children": [{"rtctrlRsScopeToAttrP": {"attributes": {"tnRtctrlAttrPName": action_rule}}}], - } + { + "rtctrlScope": { + "attributes": {"descr": ""}, + "children": [{"rtctrlRsScopeToAttrP": {"attributes": {"tnRtctrlAttrPName": action_rule}}}], + } } ) @@ -314,4 +330,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/plugins/modules/aci_match_as_path_regex_term.py b/plugins/modules/aci_match_as_path_regex_term.py index 05ce7b25a..181ea4d2b 100644 --- a/plugins/modules/aci_match_as_path_regex_term.py +++ b/plugins/modules/aci_match_as_path_regex_term.py @@ -12,7 +12,7 @@ DOCUMENTATION = r""" --- -module: aci_subject_profile +module: aci_match_as_path_regex_term short_description: Manage Match Regular Expression AS-Path Term (rtctrl:MatchAsPathRegexTerm) description: - Manage Match Rule Based on Route Regular Expression AS-Path for Subject Profiles on Cisco ACI fabrics. @@ -187,7 +187,7 @@ def main(): argument_spec.update(aci_owner_spec()) argument_spec.update( tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects - subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects + subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects match_as_path_regex_term=dict(type="str", aliases=["name", "match_rule_name"]), regex=dict(type="str"), description=dict(type="str", aliases=["descr"]), @@ -216,23 +216,23 @@ def main(): aci.construct_url( root_class=dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ), + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ), subclass_1=dict( - aci_class="rtctrlSubjP", - aci_rn="subj-{0}".format(subject_profile), - module_object=subject_profile, - target_filter={"name": subject_profile}, - ), + aci_class="rtctrlSubjP", + aci_rn="subj-{0}".format(subject_profile), + module_object=subject_profile, + target_filter={"name": subject_profile}, + ), subclass_2=dict( - aci_class="rtctrlMatchAsPathRegexTerm", - aci_rn="aspathrxtrm-{0}".format(match_as_path_regex_term), - module_object=match_as_path_regex_term, - target_filter={"name": match_as_path_regex_term}, - ), + aci_class="rtctrlMatchAsPathRegexTerm", + aci_rn="aspathrxtrm-{0}".format(match_as_path_regex_term), + module_object=match_as_path_regex_term, + target_filter={"name": match_as_path_regex_term}, + ), ) aci.get_existing() @@ -259,4 +259,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/plugins/modules/aci_match_community_factor.py b/plugins/modules/aci_match_community_factor.py index c8da456df..70f94bbd6 100644 --- a/plugins/modules/aci_match_community_factor.py +++ b/plugins/modules/aci_match_community_factor.py @@ -12,7 +12,7 @@ DOCUMENTATION = r""" --- -module: aci_subject_profile +module: aci_match_community_factor short_description: Manage Match Community Factor (rtctrl:MatchCommFactor) description: - Manage Match Community Factors for Match Rules Based on Community on Cisco ACI fabrics. @@ -194,8 +194,8 @@ def main(): argument_spec.update(aci_owner_spec()) argument_spec.update( tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects - subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects - match_community_term=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects + subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects + match_community_term=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects community=dict(type="str"), scope=dict(type="str", choices=["transitive", "non-transitive"]), description=dict(type="str", aliases=["descr"]), @@ -225,29 +225,29 @@ def main(): aci.construct_url( root_class=dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ), + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ), subclass_1=dict( - aci_class="rtctrlSubjP", - aci_rn="subj-{0}".format(subject_profile), - module_object=subject_profile, - target_filter={"name": subject_profile}, - ), + aci_class="rtctrlSubjP", + aci_rn="subj-{0}".format(subject_profile), + module_object=subject_profile, + target_filter={"name": subject_profile}, + ), subclass_2=dict( - aci_class="rtctrlMatchCommTerm", - aci_rn="commtrm-{0}".format(match_community_term), - module_object=match_community_term, - target_filter={"name": match_community_term}, - ), + aci_class="rtctrlMatchCommTerm", + aci_rn="commtrm-{0}".format(match_community_term), + module_object=match_community_term, + target_filter={"name": match_community_term}, + ), subclass_3=dict( - aci_class="rtctrlMatchCommFactor", - aci_rn="commfct-{0}".format(community), - module_object=community, - target_filter={"community": community}, - ), + aci_class="rtctrlMatchCommFactor", + aci_rn="commfct-{0}".format(community), + module_object=community, + target_filter={"community": community}, + ), ) aci.get_existing() @@ -274,4 +274,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/plugins/modules/aci_match_community_regex_term.py b/plugins/modules/aci_match_community_regex_term.py index 34bc52094..c64066d96 100644 --- a/plugins/modules/aci_match_community_regex_term.py +++ b/plugins/modules/aci_match_community_regex_term.py @@ -12,7 +12,7 @@ DOCUMENTATION = r""" --- -module: aci_subject_profile +module: aci_match_community_regex_term short_description: Manage Match Regular Expression Community Term (rtctrl:MatchCommRegexTerm) description: - Manage Match Rule Based on Route Regular Expression Community for Subject Profiles on Cisco ACI fabrics. @@ -37,6 +37,7 @@ - The Community Type. type: str choices: [ extended, regular ] + default: regular regex: description: - The Regular Expression. @@ -192,8 +193,8 @@ def main(): argument_spec.update(aci_annotation_spec()) argument_spec.update(aci_owner_spec()) argument_spec.update( - tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects - subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects + tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects + subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects match_community_regex_term=dict(type="str", aliases=["name", "match_rule_name"]), community_type=dict(type="str", default="regular", choices=["extended", "regular"]), regex=dict(type="str"), @@ -224,23 +225,23 @@ def main(): aci.construct_url( root_class=dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ), + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ), subclass_1=dict( - aci_class="rtctrlSubjP", - aci_rn="subj-{0}".format(subject_profile), - module_object=subject_profile, - target_filter={"name": subject_profile}, - ), + aci_class="rtctrlSubjP", + aci_rn="subj-{0}".format(subject_profile), + module_object=subject_profile, + target_filter={"name": subject_profile}, + ), subclass_2=dict( - aci_class="rtctrlMatchCommRegexTerm", - aci_rn="commrxtrm-{0}".format(community_type), - module_object=community_type, - target_filter={"commType": community_type}, - ), + aci_class="rtctrlMatchCommRegexTerm", + aci_rn="commrxtrm-{0}".format(community_type), + module_object=community_type, + target_filter={"commType": community_type}, + ), ) aci.get_existing() @@ -268,4 +269,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/plugins/modules/aci_match_community_term.py b/plugins/modules/aci_match_community_term.py index 83fc50837..644bfead7 100644 --- a/plugins/modules/aci_match_community_term.py +++ b/plugins/modules/aci_match_community_term.py @@ -12,7 +12,7 @@ DOCUMENTATION = r""" --- -module: aci_subject_profile +module: aci_match_community_term short_description: Manage Match Community Term (rtctrl:MatchCommTerm) description: - Manage Match Rule Based on Community for Subject Profiles on Cisco ACI fabrics. @@ -183,7 +183,7 @@ def main(): argument_spec.update(aci_owner_spec()) argument_spec.update( tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects - subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects + subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects match_community_term=dict(type="str", aliases=["name", "match_rule_name"]), description=dict(type="str", aliases=["descr"]), name_alias=dict(type="str"), @@ -210,23 +210,23 @@ def main(): aci.construct_url( root_class=dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ), + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ), subclass_1=dict( - aci_class="rtctrlSubjP", - aci_rn="subj-{0}".format(subject_profile), - module_object=subject_profile, - target_filter={"name": subject_profile}, - ), + aci_class="rtctrlSubjP", + aci_rn="subj-{0}".format(subject_profile), + module_object=subject_profile, + target_filter={"name": subject_profile}, + ), subclass_2=dict( - aci_class="rtctrlMatchCommTerm", - aci_rn="commtrm-{0}".format(match_community_term), - module_object=match_community_term, - target_filter={"name": match_community_term}, - ), + aci_class="rtctrlMatchCommTerm", + aci_rn="commtrm-{0}".format(match_community_term), + module_object=match_community_term, + target_filter={"name": match_community_term}, + ), ) aci.get_existing() @@ -252,4 +252,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/plugins/modules/aci_match_route_destination.py b/plugins/modules/aci_match_route_destination.py index 2c3faf7d4..f068d1c02 100644 --- a/plugins/modules/aci_match_route_destination.py +++ b/plugins/modules/aci_match_route_destination.py @@ -12,7 +12,7 @@ DOCUMENTATION = r""" --- -module: aci_subject_profile +module: aci_match_route_destination short_description: Manage Match action rule based on the Route Destination. (rtctrl:MatchRtDest) description: - Match action rule based on the Route Destination for Subject Profiles on Cisco ACI fabrics. @@ -35,16 +35,17 @@ description: - Option to enable/disable aggregated route. type: str - choices: [ yes, no ] + choices: [ "no", "yes" ] from_prefix_lenght: description: - Start of the prefix lenght. - It corresponds to the less equal Mask if the route is aggregated. - type: str + type: int to_prefix_lenght: description: - End of the prefix lenght. - It corresponds to greater equal Mask if the route is aggregated. + type: int description: description: - The description for the Match Action Rule. @@ -196,7 +197,7 @@ def main(): argument_spec.update(aci_owner_spec()) argument_spec.update( tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects - subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects + subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects ip=dict(type="str"), aggregate=dict(type="str", choices=["no", "yes"]), from_prefix_lenght=dict(type="int"), @@ -229,23 +230,23 @@ def main(): aci.construct_url( root_class=dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ), + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ), subclass_1=dict( - aci_class="rtctrlSubjP", - aci_rn="subj-{0}".format(subject_profile), - module_object=subject_profile, - target_filter={"name": subject_profile}, - ), + aci_class="rtctrlSubjP", + aci_rn="subj-{0}".format(subject_profile), + module_object=subject_profile, + target_filter={"name": subject_profile}, + ), subclass_2=dict( - aci_class="rtctrlMatchRtDest", - aci_rn="dest-[{0}]".format(ip), - module_object=ip, - target_filter={"ip": ip}, - ), + aci_class="rtctrlMatchRtDest", + aci_rn="dest-[{0}]".format(ip), + module_object=ip, + target_filter={"ip": ip}, + ), ) aci.get_existing() @@ -274,4 +275,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/plugins/modules/aci_route_control_profile.py b/plugins/modules/aci_route_control_profile.py index ee1b70d47..18e9d2a84 100644 --- a/plugins/modules/aci_route_control_profile.py +++ b/plugins/modules/aci_route_control_profile.py @@ -32,6 +32,18 @@ - Name of the route control profile being created. type: str aliases: [ name, rtctrl_profile_name ] + auto_continue: + description: + - Option to enable/disable auto-continue. + type: str + choices: [ "no", "yes" ] + default: "no" + policy_type: + description: + - Set the policy type to combinable or global. + type: str + choices: [ combinable, global ] + default: combinable description: description: - The description for the route control profile. @@ -184,7 +196,7 @@ def main(): argument_spec.update( tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects l3out=dict(type="str", aliases=["l3out_name"]), # Not required for querying all objects - route_control_profile = dict(type="str", aliases=["name", "rtctrl_profile_name"]), # Not required for querying all objects + route_control_profile=dict(type="str", aliases=["name", "rtctrl_profile_name"]), # Not required for querying all objects description=dict(type="str", aliases=["descr"]), auto_continue=dict(type="str", default="no", choices=["no", "yes"]), policy_type=dict(type="str", default="combinable", choices=["combinable", "global"]), @@ -213,19 +225,19 @@ def main(): aci = ACIModule(module) tenant_url_config = dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ) - + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ) + route_control_profile_url_config = dict( - aci_class="rtctrlProfile", - aci_rn="prof-{0}".format(route_control_profile), - module_object=route_control_profile, - target_filter={"name": route_control_profile}, - ) - + aci_class="rtctrlProfile", + aci_rn="prof-{0}".format(route_control_profile), + module_object=route_control_profile, + target_filter={"name": route_control_profile}, + ) + if l3out is not None: aci.construct_url( root_class=tenant_url_config, @@ -268,4 +280,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/plugins/modules/aci_subject_profile.py b/plugins/modules/aci_subject_profile.py index 4ee7f9d7f..9d40d6b18 100644 --- a/plugins/modules/aci_subject_profile.py +++ b/plugins/modules/aci_subject_profile.py @@ -178,7 +178,7 @@ def main(): argument_spec.update(aci_owner_spec()) argument_spec.update( tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects - subject_profile=dict(type="str", aliases=["name", "subject_name"]), # Not required for querying all objects + subject_profile=dict(type="str", aliases=["name", "subject_name"]), # Not required for querying all objects description=dict(type="str", aliases=["descr"]), name_alias=dict(type="str"), state=dict(type="str", default="present", choices=["present", "absent", "query"]), @@ -203,17 +203,17 @@ def main(): aci.construct_url( root_class=dict( - aci_class="fvTenant", - aci_rn="tn-{0}".format(tenant), - module_object=tenant, - target_filter={"name": tenant}, - ), + aci_class="fvTenant", + aci_rn="tn-{0}".format(tenant), + module_object=tenant, + target_filter={"name": tenant}, + ), subclass_1=dict( - aci_class="rtctrlSubjP", - aci_rn="subj-{0}".format(subject_profile), - module_object=subject_profile, - target_filter={"name": subject_profile}, - ), + aci_class="rtctrlSubjP", + aci_rn="subj-{0}".format(subject_profile), + module_object=subject_profile, + target_filter={"name": subject_profile}, + ), ) aci.get_existing() @@ -239,4 +239,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main()