From d23d290be80ef18475fc722a066e4bb4a4dcf2fe Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Fri, 12 Jan 2018 12:20:20 +0100 Subject: [PATCH] aci_aep: Add infrastructure_vlan support (infra:ProvAcc) (#33996) This is a needed enhancement. --- lib/ansible/modules/network/aci/aci_aep.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/aci/aci_aep.py b/lib/ansible/modules/network/aci/aci_aep.py index 34bb205303..422e22ac2b 100644 --- a/lib/ansible/modules/network/aci/aci_aep.py +++ b/lib/ansible/modules/network/aci/aci_aep.py @@ -13,12 +13,12 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', 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' @@ -33,6 +33,14 @@ options: 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. @@ -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']), ) @@ -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( @@ -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