Skip to content

Commit

Permalink
[minor_change] Rename module aci_context_policy and aci_subject_profi…
Browse files Browse the repository at this point in the history
…le to aci_route_control_context and aci_match_rule. Applied changes to all Documentations and Modules.
  • Loading branch information
gmicol committed Oct 5, 2023
1 parent 0dcf72c commit 5d7acdb
Show file tree
Hide file tree
Showing 19 changed files with 894 additions and 524 deletions.
74 changes: 59 additions & 15 deletions plugins/modules/aci_match_as_path_regex_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
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.
- Manage Match Term Based on Route Regular Expression AS-Path for Match Rule Profiles on Cisco ACI fabrics.
options:
tenant:
description:
- The name of an existing tenant.
type: str
aliases: [ tenant_name ]
subject_profile:
match_rule:
description:
- Name of an exising subject profile.
- The name of an exising match rule profile.
type: str
aliases: [ subject_name ]
aliases: [ match_rule_name ]
match_as_path_regex_term:
description:
- Name of the Match Regular Expression AS-Path Term.
- The name of the match regex AS-Path term.
type: str
aliases: [ name, match_rule_name ]
aliases: [ name, match_as_path_regex_term_name ]
regex:
description:
- The Regular Expression.
type: str
description:
description:
- The description for the Match Regular Expression AS-Path Term.
- The description for the match regex AS-Path term.
type: str
aliases: [ descr ]
state:
Expand All @@ -58,10 +58,11 @@
- cisco.aci.owner
notes:
- The C(tenant) and the C(subject_profile) used must exist before using this module in your playbook.
The M(cisco.aci.aci_tenant) and the M(cisco.aci.subject_profile) modules can be used for this.
- The C(tenant) and the C(match_rule) used must exist before using this module in your playbook.
The M(cisco.aci.aci_tenant) and the M(cisco.aci.aci_match_rule) modules can be used for this.
seealso:
- module: cisco.aci.aci_tenant
- module: cisco.aci.aci_match_rule
- name: APIC Management Information Model reference
description: More information about the internal APIC class B(rtctrl:MatchAsPathRegexTerm).
link: https://developer.cisco.com/docs/apic-mim-ref/
Expand All @@ -70,6 +71,49 @@
"""

EXAMPLES = r"""
- name: Create a match match AS-path regex term
cisco.aci.match_as_path_regex_term:
host: apic
username: admin
password: SomeSecretPassword
match_rule: prod_match_rule
match_as_path_regex_term: prod_match_as_path_regex_term
regex: .*
tenant: production
state: present
delegate_to: localhost
- name: Delete a match match AS-path regex term
cisco.aci.match_as_path_regex_term:
host: apic
username: admin
password: SomeSecretPassword
match_rule: prod_match_rule
tenant: production
match_as_path_regex_term: prod_match_as_path_regex_term
state: absent
delegate_to: localhost
- name: Query all match AS-path regex terms
cisco.aci.match_as_path_regex_term:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
- name: Query a specific match match AS-path regex term
cisco.aci.match_as_path_regex_term:
host: apic
username: admin
password: SomeSecretPassword
match_rule: prod_match_rule
tenant: production
match_as_path_regex_term: prod_match_as_path_regex_term
state: query
delegate_to: localhost
register: query_result
"""

RETURN = r"""
Expand Down Expand Up @@ -187,8 +231,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_as_path_regex_term=dict(type="str", aliases=["name", "match_rule_name"]),
match_rule=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects
match_as_path_regex_term=dict(type="str", aliases=["name", "match_as_path_regex_term_name"]),
regex=dict(type="str"),
description=dict(type="str", aliases=["descr"]),
name_alias=dict(type="str"),
Expand All @@ -209,7 +253,7 @@ def main():
regex = module.params.get("regex")
state = module.params.get("state")
tenant = module.params.get("tenant")
subject_profile = module.params.get("subject_profile")
match_rule = module.params.get("match_rule")
name_alias = module.params.get("name_alias")

aci = ACIModule(module)
Expand All @@ -223,9 +267,9 @@ def main():
),
subclass_1=dict(
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
aci_rn="subj-{0}".format(match_rule),
module_object=match_rule,
target_filter={"name": match_rule},
),
subclass_2=dict(
aci_class="rtctrlMatchAsPathRegexTerm",
Expand Down
86 changes: 67 additions & 19 deletions plugins/modules/aci_match_community_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@
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.
- Manage Match Community Factors for Match Terms Based on Community on Cisco ACI fabrics.
options:
tenant:
description:
- The name of an existing tenant.
type: str
aliases: [ tenant_name ]
subject_profile:
match_rule:
description:
- Name of an exising subject profile.
- The name of an exising match rule profile.
type: str
aliases: [ subject_name ]
aliases: [ match_rule_name ]
match_community_term:
description:
- Name of an existing match community term.
- The name of an existing match community term.
type: str
aliases: [ match_rule_name ]
aliases: [ match_community_term_name ]
community:
description:
- The match community value.
type: str
scope:
description:
- The item scope.
- if the scope is transitive, this community may be passed between ASs.
- if the scope is Non transitive, this community should be carried only within the local AS.
- If the scope is transitive, this community may be passed between ASs.
- If the scope is Non transitive, this community should be carried only within the local AS.
type: str
choices: [ transitive, non-transitive ]
description:
description:
- The description for the Match Community Term.
- The description for the match community factor.
type: str
aliases: [ descr ]
state:
Expand All @@ -65,10 +65,12 @@
- cisco.aci.owner
notes:
- The C(tenant), the C(subject_profile) and the C(match_community_term) used must exist before using this module in your playbook.
The M(cisco.aci.aci_tenant), the M(cisco.aci.subject_profile) and M(cisco.aci.match_community_term) modules can be used for this.
- The C(tenant), the C(match_rule) and the C(match_community_term) used must exist before using this module in your playbook.
The M(cisco.aci.aci_tenant), the M(cisco.aci.aci_match_rule) and M(cisco.aci.aci_match_community_term) modules can be used for this.
seealso:
- module: cisco.aci.aci_tenant
- module: cisco.aci.aci_match_rule
- module: cisco.aci.aci_match_community_term
- name: APIC Management Information Model reference
description: More information about the internal APIC class B(rtctrl:MatchCommFactor).
link: https://developer.cisco.com/docs/apic-mim-ref/
Expand All @@ -77,6 +79,52 @@
"""

EXAMPLES = r"""
- name: Create a match match AS-path regex term
cisco.aci.match_community_term:
host: apic
username: admin
password: SomeSecretPassword
match_rule: prod_match_rule
match_community_term: prod_match_community_term
community: regular:as2-nn2:4:15
scope: transitive
tenant: production
state: present
delegate_to: localhost
- name: Delete a match match AS-path regex term
cisco.aci.match_community_term:
host: apic
username: admin
password: SomeSecretPassword
match_rule: prod_match_rule
tenant: production
match_community_term: prod_match_community_term
community: regular:as2-nn2:4:15
state: absent
delegate_to: localhost
- name: Query all match AS-path regex terms
cisco.aci.match_community_term:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
- name: Query a specific match match AS-path regex term
cisco.aci.match_community_term:
host: apic
username: admin
password: SomeSecretPassword
match_rule: prod_match_rule
tenant: production
match_community_term: prod_match_community_term
community: regular:as2-nn2:4:15
state: query
delegate_to: localhost
register: query_result
"""

RETURN = r"""
Expand Down Expand Up @@ -194,8 +242,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
match_rule=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects
match_community_term=dict(type="str", aliases=["match_community_term_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"]),
Expand All @@ -207,8 +255,8 @@ def main():
argument_spec=argument_spec,
supports_check_mode=True,
required_if=[
["state", "absent", ["community", "tenant", "subject_profile", "match_community_term"]],
["state", "present", ["community", "tenant", "subject_profile", "match_community_term"]],
["state", "absent", ["community", "tenant", "match_rule", "match_community_term"]],
["state", "present", ["community", "tenant", "match_rule", "match_community_term"]],
],
)

Expand All @@ -217,7 +265,7 @@ def main():
description = module.params.get("description")
state = module.params.get("state")
tenant = module.params.get("tenant")
subject_profile = module.params.get("subject_profile")
match_rule = module.params.get("match_rule")
match_community_term = module.params.get("match_community_term")
name_alias = module.params.get("name_alias")

Expand All @@ -232,9 +280,9 @@ def main():
),
subclass_1=dict(
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
aci_rn="subj-{0}".format(match_rule),
module_object=match_rule,
target_filter={"name": match_rule},
),
subclass_2=dict(
aci_class="rtctrlMatchCommTerm",
Expand Down
Loading

0 comments on commit 5d7acdb

Please sign in to comment.