mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07: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:
|
description:
|
||||||
- The name of the fabric access policy group to be associated with the leaf interface profile interface selector.
|
- The name of the fabric access policy group to be associated with the leaf interface profile interface selector.
|
||||||
aliases: [ policy_group_name ]
|
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:
|
state:
|
||||||
description:
|
description:
|
||||||
- Use C(present) or C(absent) for adding or removing.
|
- 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']),
|
'from': dict(type='str', aliases=['fromPort', 'from_port_range']),
|
||||||
'to': dict(type='str', aliases=['toPort', 'to_port_range']),
|
'to': dict(type='str', aliases=['toPort', 'to_port_range']),
|
||||||
'policy_group': dict(type='str', aliases=['policy_group_name']),
|
'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']),
|
'state': dict(type='str', default='present', choices=['absent', 'present', 'query']),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -255,6 +262,7 @@ def main():
|
||||||
from_ = module.params['from']
|
from_ = module.params['from']
|
||||||
to_ = module.params['to']
|
to_ = module.params['to']
|
||||||
policy_group = module.params['policy_group']
|
policy_group = module.params['policy_group']
|
||||||
|
interface_type = module.params['interface_type']
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
|
|
||||||
aci = ACIModule(module)
|
aci = ACIModule(module)
|
||||||
|
@ -274,6 +282,14 @@ def main():
|
||||||
),
|
),
|
||||||
child_classes=['infraPortBlk', 'infraRsAccBaseGrp']
|
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()
|
aci.get_existing()
|
||||||
|
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
|
@ -297,7 +313,7 @@ def main():
|
||||||
dict(
|
dict(
|
||||||
infraRsAccBaseGrp=dict(
|
infraRsAccBaseGrp=dict(
|
||||||
attributes=dict(
|
attributes=dict(
|
||||||
tDn='uni/infra/funcprof/accportgrp-{0}'.format(policy_group),
|
tDn=INTERFACE_TYPE_MAPPING[interface_type],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue