mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
changed accportgrp to accbundle (#40104)
* changed accportgrp to accbundle * fixed shippable complaints * changed policy_group_type to interface_type
This commit is contained in:
parent
1328cc1fa0
commit
4c0ceaea3d
1 changed files with 17 additions and 1 deletions
|
@ -60,6 +60,12 @@ options:
|
|||
description:
|
||||
- The name of the fabric access policy group to be associated with the leaf interface profile interface selector.
|
||||
aliases: [ policy_group_name ]
|
||||
interface_type:
|
||||
version_added: '2.6'
|
||||
description:
|
||||
- The type of interface for the static EPG deployement.
|
||||
choices: [ fex, port_channel, switch_port, vpc ]
|
||||
default: switch_port
|
||||
state:
|
||||
description:
|
||||
- Use C(present) or C(absent) for adding or removing.
|
||||
|
@ -235,6 +241,7 @@ def main():
|
|||
'from': dict(type='str', aliases=['fromPort', 'from_port_range']),
|
||||
'to': dict(type='str', aliases=['toPort', 'to_port_range']),
|
||||
'policy_group': dict(type='str', aliases=['policy_group_name']),
|
||||
'interface_type': dict(type='str', default='switch_port', choices=['fex', 'port_channel', 'switch_port', 'vpc']),
|
||||
'state': dict(type='str', default='present', choices=['absent', 'present', 'query']),
|
||||
})
|
||||
|
||||
|
@ -255,6 +262,7 @@ def main():
|
|||
from_ = module.params['from']
|
||||
to_ = module.params['to']
|
||||
policy_group = module.params['policy_group']
|
||||
interface_type = module.params['interface_type']
|
||||
state = module.params['state']
|
||||
|
||||
aci = ACIModule(module)
|
||||
|
@ -274,6 +282,14 @@ def main():
|
|||
),
|
||||
child_classes=['infraPortBlk', 'infraRsAccBaseGrp']
|
||||
)
|
||||
|
||||
INTERFACE_TYPE_MAPPING = dict(
|
||||
fex='uni/infra/funcprof/accportgrp-{0}'.format(policy_group),
|
||||
port_channel='uni/infra/funcprof/accbundle-{0}'.format(policy_group),
|
||||
switch_port='uni/infra/funcprof/accportgrp-{0}'.format(policy_group),
|
||||
vpc='uni/infra/funcprof/accbundle-{0}'.format(policy_group),
|
||||
)
|
||||
|
||||
aci.get_existing()
|
||||
|
||||
if state == 'present':
|
||||
|
@ -297,7 +313,7 @@ def main():
|
|||
dict(
|
||||
infraRsAccBaseGrp=dict(
|
||||
attributes=dict(
|
||||
tDn='uni/infra/funcprof/accportgrp-{0}'.format(policy_group),
|
||||
tDn=INTERFACE_TYPE_MAPPING[interface_type],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue