Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion plugins/modules/aci_bd_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
- The name of the Subnet.
type: str
aliases: [ name ]
ip_data_plane_learning:
description:
- Whether IP data plane learning is enabled or disabled.
- The APIC defaults to C(enabled) when unset during creation.
type: str
choices: [ enabled, disabled ]
aliases: [ ip_dataplane_learning ]
tenant:
description:
- The name of the Tenant.
Expand Down Expand Up @@ -369,6 +376,7 @@ def main():
state=dict(type="str", default="present", choices=["absent", "present", "query"]),
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
name_alias=dict(type="str"),
ip_data_plane_learning=dict(type="str", choices=["enabled", "disabled"], aliases=["ip_dataplane_learning"]),
)

module = AnsibleModule(
Expand Down Expand Up @@ -410,7 +418,7 @@ def main():
if subnet_control:
subnet_control = SUBNET_CONTROL_MAPPING[subnet_control]
name_alias = module.params.get("name_alias")

ip_data_plane_learning = module.params.get("ip_data_plane_learning")
aci.construct_url(
root_class=dict(
aci_class="fvTenant",
Expand Down Expand Up @@ -447,6 +455,7 @@ def main():
scope=scope,
virtual=enable_vip,
nameAlias=name_alias,
ipDPLearning=ip_data_plane_learning,
),
child_configs=[
{"fvRsBDSubnetToProfile": {"attributes": {"tnL3extOutName": route_profile_l3_out, "tnRtctrlProfileName": route_profile}}},
Expand Down
10 changes: 10 additions & 0 deletions plugins/modules/aci_vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
- The description for the VRF.
type: str
aliases: [ descr ]
ip_data_plane_learning:
description:
- Whether IP data plane learning is enabled or disabled.
- The APIC defaults to C(enabled) when unset during creation.
type: str
choices: [ enabled, disabled ]
aliases: [ ip_dataplane_learning ]
state:
description:
- Use C(present) or C(absent) for adding or removing.
Expand Down Expand Up @@ -256,6 +263,7 @@ def main():
preferred_group=dict(type="str", choices=["enabled", "disabled"]),
match_type=dict(type="str", choices=["all", "at_least_one", "at_most_one", "none"]),
name_alias=dict(type="str"),
ip_data_plane_learning=dict(type="str", choices=["enabled", "disabled"], aliases=["ip_dataplane_learning"]),
)

module = AnsibleModule(
Expand All @@ -276,6 +284,7 @@ def main():
name_alias = module.params.get("name_alias")
preferred_group = module.params.get("preferred_group")
match_type = module.params.get("match_type")
ip_data_plane_learning = module.params.get("ip_data_plane_learning")

if match_type is not None:
match_type = MATCH_TYPE_MAPPING[match_type]
Expand Down Expand Up @@ -308,6 +317,7 @@ def main():
pcEnfPref=policy_control_preference,
name=vrf,
nameAlias=name_alias,
ipDataPlaneLearning=ip_data_plane_learning,
),
child_configs=[
dict(vzAny=dict(attributes=dict(prefGrMemb=preferred_group, matchT=match_type))),
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/targets/aci_bd_subnet/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
scope: [private, shared]
route_profile: default
route_profile_l3_out: default
ip_data_plane_learning: disabled
register: create_subnet2

- name: create subnet again - idempotency works
Expand Down Expand Up @@ -105,8 +106,10 @@
- create_check_mode.sent.fvSubnet.attributes.name == create_subnet.sent.fvSubnet.attributes.name == 'anstest'
- create_subnet is changed
- create_subnet.current.0.fvSubnet.attributes.annotation == 'orchestrator:ansible'
- create_subnet.current.0.fvSubnet.attributes.ipDPLearning == 'enabled'
- create_subnet.previous == []
- create_subnet2 is changed
- create_subnet2.current.0.fvSubnet.attributes.ipDPLearning == 'disabled'
- create_subnet2.sent == create_subnet2.proposed
- create_subnet2.sent.fvSubnet.attributes.scope == "private,shared"
- create_subnet2.sent.fvSubnet.children.0.fvRsBDSubnetToProfile.attributes.tnL3extOutName == 'default'
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/targets/aci_vrf/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
policy_control_direction: egress
preferred_group: enabled
match_type: all
ip_data_plane_learning: disabled
register: vrf_present_2

- name: create vrf without all necessary params - failure message works
Expand All @@ -80,6 +81,7 @@
- vrf_present is changed
- vrf_present.sent == vrf_present_check_mode.sent
- vrf_present.current.0.fvCtx.attributes.annotation == 'orchestrator:ansible'
- vrf_present.current.0.fvCtx.attributes.ipDataPlaneLearning == 'enabled'
- vrf_present.previous == []
- vrf_present_idempotent is not changed
- vrf_present_idempotent.previous != []
Expand All @@ -88,9 +90,11 @@
- vrf_update.sent != vrf_update.proposed
- vrf_update.sent.fvCtx.attributes.descr == 'Ansible Test Update'
- vrf_update.sent.fvCtx.attributes.pcEnfPref == 'unenforced'
- vrf_update.current.0.fvCtx.attributes.ipDataPlaneLearning == 'enabled'
- vrf_present_2.sent.fvCtx.attributes.name == 'anstest2'
- vrf_present_2.sent.fvCtx.attributes.pcEnfDir == 'egress'
- vrf_present_2.sent.fvCtx.attributes.descr == 'Ansible Test'
- vrf_present_2.current.0.fvCtx.attributes.ipDataPlaneLearning == 'disabled'
- vrf_present_2.current.0.fvCtx.children.0.vzAny.attributes.matchT == 'All'
- vrf_present_2.current.0.fvCtx.children.0.vzAny.attributes.prefGrMemb == 'enabled'
- vrf_present_missing_param is failed
Expand Down