aci_epg: Add support for Preferred Group Membership (#35265)

* aci_epg: Add support for Preferred Group Membership

* ACI defaults to 'no'

* Add 'version_added'

* Make use of aci.boolean()
This commit is contained in:
Dag Wieers 2018-02-02 19:23:19 +01:00 committed by GitHub
parent 7b76da2d4c
commit 36bd24f121
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,13 @@ options:
- The APIC defaults new EPGs to C(none).
choices: [ none, proxy-arp ]
default: none
preferred_group:
description:
- Whether ot not the EPG is part of the Preferred Group and can communicate without contracts.
- This is very convenient for migration scenarios, or when ACI is used for network automation but not for policy.
type: bool
default: 'no'
version_added: '2.5'
state:
description:
- Use C(present) or C(absent) for adding or removing.
@ -84,6 +91,7 @@ EXAMPLES = r'''
epg: web_epg
description: Web Intranet EPG
bd: prod_bd
preferred_group: yes
- aci_epg:
host: apic
@ -169,6 +177,7 @@ def main():
priority=dict(type='str', choices=['level1', 'level2', 'level3', 'unspecified']),
intra_epg_isolation=dict(choices=['enforced', 'unenforced']),
fwd_control=dict(type='str', choices=['none', 'proxy-arp']),
preferred_group=dict(type='bool'),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
method=dict(type='str', choices=['delete', 'get', 'post'], aliases=['action'], removed_in_version='2.6'), # Deprecated starting from v2.6
protocol=dict(type='str', removed_in_version='2.6'), # Deprecated in v2.6
@ -183,17 +192,19 @@ def main():
],
)
aci = ACIModule(module)
epg = module.params['epg']
bd = module.params['bd']
description = module.params['description']
priority = module.params['priority']
intra_epg_isolation = module.params['intra_epg_isolation']
fwd_control = module.params['fwd_control']
preferred_group = aci.boolean(module.params['preferred_group'], 'include', 'exclude')
state = module.params['state']
tenant = module.params['tenant']
ap = module.params['ap']
aci = ACIModule(module)
aci.construct_url(
root_class=dict(
aci_class='fvTenant',
@ -228,6 +239,7 @@ def main():
prio=priority,
pcEnfPref=intra_epg_isolation,
fwdCtrl=fwd_control,
prefGrMemb=preferred_group,
),
child_configs=[
dict(fvRsBd=dict(attributes=dict(tnFvBDName=bd))),