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()pull/4420/head
parent
7b76da2d4c
commit
36bd24f121
|
@ -64,6 +64,13 @@ options:
|
||||||
- The APIC defaults new EPGs to C(none).
|
- The APIC defaults new EPGs to C(none).
|
||||||
choices: [ none, proxy-arp ]
|
choices: [ none, proxy-arp ]
|
||||||
default: none
|
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:
|
state:
|
||||||
description:
|
description:
|
||||||
- Use C(present) or C(absent) for adding or removing.
|
- Use C(present) or C(absent) for adding or removing.
|
||||||
|
@ -84,6 +91,7 @@ EXAMPLES = r'''
|
||||||
epg: web_epg
|
epg: web_epg
|
||||||
description: Web Intranet EPG
|
description: Web Intranet EPG
|
||||||
bd: prod_bd
|
bd: prod_bd
|
||||||
|
preferred_group: yes
|
||||||
|
|
||||||
- aci_epg:
|
- aci_epg:
|
||||||
host: apic
|
host: apic
|
||||||
|
@ -169,6 +177,7 @@ def main():
|
||||||
priority=dict(type='str', choices=['level1', 'level2', 'level3', 'unspecified']),
|
priority=dict(type='str', choices=['level1', 'level2', 'level3', 'unspecified']),
|
||||||
intra_epg_isolation=dict(choices=['enforced', 'unenforced']),
|
intra_epg_isolation=dict(choices=['enforced', 'unenforced']),
|
||||||
fwd_control=dict(type='str', choices=['none', 'proxy-arp']),
|
fwd_control=dict(type='str', choices=['none', 'proxy-arp']),
|
||||||
|
preferred_group=dict(type='bool'),
|
||||||
state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
|
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
|
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
|
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']
|
epg = module.params['epg']
|
||||||
bd = module.params['bd']
|
bd = module.params['bd']
|
||||||
description = module.params['description']
|
description = module.params['description']
|
||||||
priority = module.params['priority']
|
priority = module.params['priority']
|
||||||
intra_epg_isolation = module.params['intra_epg_isolation']
|
intra_epg_isolation = module.params['intra_epg_isolation']
|
||||||
fwd_control = module.params['fwd_control']
|
fwd_control = module.params['fwd_control']
|
||||||
|
preferred_group = aci.boolean(module.params['preferred_group'], 'include', 'exclude')
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
tenant = module.params['tenant']
|
tenant = module.params['tenant']
|
||||||
ap = module.params['ap']
|
ap = module.params['ap']
|
||||||
|
|
||||||
aci = ACIModule(module)
|
|
||||||
aci.construct_url(
|
aci.construct_url(
|
||||||
root_class=dict(
|
root_class=dict(
|
||||||
aci_class='fvTenant',
|
aci_class='fvTenant',
|
||||||
|
@ -228,6 +239,7 @@ def main():
|
||||||
prio=priority,
|
prio=priority,
|
||||||
pcEnfPref=intra_epg_isolation,
|
pcEnfPref=intra_epg_isolation,
|
||||||
fwdCtrl=fwd_control,
|
fwdCtrl=fwd_control,
|
||||||
|
prefGrMemb=preferred_group,
|
||||||
),
|
),
|
||||||
child_configs=[
|
child_configs=[
|
||||||
dict(fvRsBd=dict(attributes=dict(tnFvBDName=bd))),
|
dict(fvRsBd=dict(attributes=dict(tnFvBDName=bd))),
|
||||||
|
|
Loading…
Reference in New Issue