From 4c0ceaea3dde9949db34abf72ed1a665cc49e813 Mon Sep 17 00:00:00 2001 From: suacide24 Date: Thu, 17 May 2018 07:11:31 -0400 Subject: [PATCH] changed accportgrp to accbundle (#40104) * changed accportgrp to accbundle * fixed shippable complaints * changed policy_group_type to interface_type --- ...ss_port_to_interface_policy_leaf_profile.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/aci/aci_access_port_to_interface_policy_leaf_profile.py b/lib/ansible/modules/network/aci/aci_access_port_to_interface_policy_leaf_profile.py index 6260611a28c..5c47466b754 100644 --- a/lib/ansible/modules/network/aci/aci_access_port_to_interface_policy_leaf_profile.py +++ b/lib/ansible/modules/network/aci/aci_access_port_to_interface_policy_leaf_profile.py @@ -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], ), ), ),