Skip to content

Commit

Permalink
aci_aep: Add infrastructure_vlan support (infra:ProvAcc) (ansible#33996)
Browse files Browse the repository at this point in the history
This is a needed enhancement.
  • Loading branch information
dagwieers authored Jan 12, 2018
1 parent 393c5be commit d23d290
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions lib/ansible/modules/network/aci/aci_aep.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
DOCUMENTATION = r'''
---
module: aci_aep
short_description: Manage attachable Access Entity Profile (AEP) on Cisco ACI fabrics (infra:AttEntityP)
short_description: Manage attachable Access Entity Profile (AEP) on Cisco ACI fabrics (infra:AttEntityP|infra:ProvAcc)
description:
- Connect to external virtual and physical domains by using
attachable Access Entity Profiles (AEP) on Cisco ACI fabrics.
- More information from the internal APIC class
I(infra:AttEntityP) at U(https://developer.cisco.com/media/mim-ref/MO-infraAttEntityP.html).
- More information from the internal APIC classes I(infra:AttEntityP) and I(infra:ProvAcc)
at U(https://developer.cisco.com/site/aci/docs/apis/apic-mim-ref/).
author:
- Swetha Chunduri (@schunduri)
version_added: '2.4'
Expand All @@ -33,6 +33,14 @@
description:
description:
- Description for the AEP.
infra_vlan:
description:
- Enable infrastructure VLAN.
- The hypervisor functions of the AEP.
type: bool
default: 'no'
aliases: [ infrastructure_vlan ]
version_added: '2.5'
state:
description:
- Use C(present) or C(absent) for adding or removing.
Expand Down Expand Up @@ -89,6 +97,7 @@ def main():
argument_spec.update(
aep=dict(type='str', aliases=['name', 'aep_name']), # not required for querying all AEPs
description=dict(type='str', aliases=['descr']),
infra_vlan=dict(type='bool', default=False, aliases=['infrastructure_vlan']),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
)

Expand All @@ -103,8 +112,14 @@ def main():

aep = module.params['aep']
description = module.params['description']
infra_vlan = module.params['infra_vlan']
state = module.params['state']

if infra_vlan:
child_configs = [dict(infraProvAcc=dict(attributes=dict(name='provacc')))]
else:
child_configs = []

aci = ACIModule(module)
aci.construct_url(
root_class=dict(
Expand All @@ -124,6 +139,7 @@ def main():
name=aep,
descr=description,
),
child_configs=child_configs,
)

# Generate config diff which will be used as POST request body
Expand Down

0 comments on commit d23d290

Please sign in to comment.