aci_aep: Add infrastructure_vlan support (infra:ProvAcc) (#33996)

This is a needed enhancement.
This commit is contained in:
Dag Wieers 2018-01-12 12:20:20 +01:00 committed by GitHub
parent 393c5bea67
commit d23d290be8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,12 +13,12 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = r''' DOCUMENTATION = r'''
--- ---
module: aci_aep 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: description:
- Connect to external virtual and physical domains by using - Connect to external virtual and physical domains by using
attachable Access Entity Profiles (AEP) on Cisco ACI fabrics. attachable Access Entity Profiles (AEP) on Cisco ACI fabrics.
- More information from the internal APIC class - More information from the internal APIC classes I(infra:AttEntityP) and I(infra:ProvAcc)
I(infra:AttEntityP) at U(https://developer.cisco.com/media/mim-ref/MO-infraAttEntityP.html). at U(https://developer.cisco.com/site/aci/docs/apis/apic-mim-ref/).
author: author:
- Swetha Chunduri (@schunduri) - Swetha Chunduri (@schunduri)
version_added: '2.4' version_added: '2.4'
@ -33,6 +33,14 @@ options:
description: description:
description: description:
- Description for the AEP. - 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: state:
description: description:
- Use C(present) or C(absent) for adding or removing. - Use C(present) or C(absent) for adding or removing.
@ -89,6 +97,7 @@ def main():
argument_spec.update( argument_spec.update(
aep=dict(type='str', aliases=['name', 'aep_name']), # not required for querying all AEPs aep=dict(type='str', aliases=['name', 'aep_name']), # not required for querying all AEPs
description=dict(type='str', aliases=['descr']), 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']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
) )
@ -103,8 +112,14 @@ def main():
aep = module.params['aep'] aep = module.params['aep']
description = module.params['description'] description = module.params['description']
infra_vlan = module.params['infra_vlan']
state = module.params['state'] state = module.params['state']
if infra_vlan:
child_configs = [dict(infraProvAcc=dict(attributes=dict(name='provacc')))]
else:
child_configs = []
aci = ACIModule(module) aci = ACIModule(module)
aci.construct_url( aci.construct_url(
root_class=dict( root_class=dict(
@ -124,6 +139,7 @@ def main():
name=aep, name=aep,
descr=description, descr=description,
), ),
child_configs=child_configs,
) )
# Generate config diff which will be used as POST request body # Generate config diff which will be used as POST request body