Aci access port to interface policy leaf profile (#34842)

* ACI_ACC_PORT_TO_INTF_POL_LEAF_PROF: Change from/to to standard used elsewhere

* ACI_ACC_PORT_TO_INTF_POL_LEAF_PROF: Add description options

* ACI_ACC_PORT_TO_INTF_POL_LEAF_PROF: Add missing trailing commas
This commit is contained in:
Jacob McGill 2018-01-13 23:43:44 -05:00 committed by ansibot
parent 3c7e639dde
commit aa9fc9313f

View file

@ -33,21 +33,29 @@ options:
- The name of the Fabric access policy leaf interface profile access port selector. - The name of the Fabric access policy leaf interface profile access port selector.
required: yes required: yes
aliases: [ name, access_port_selector_name ] aliases: [ name, access_port_selector_name ]
description:
description:
- The description to assign to the C(access_port_selector)
required: no
leaf_port_blk: leaf_port_blk:
description: description:
- The name of the Fabric access policy leaf interface profile access port block. - The name of the Fabric access policy leaf interface profile access port block.
required: yes required: yes
aliases: [ leaf_port_blk_name ] aliases: [ leaf_port_blk_name ]
fromPort: leaf_port_blk_description:
description:
- The description to assign to the C(leaf_port_blk)
required: no
from:
description: description:
- The beggining (from range) of the port range block for the leaf access port block. - The beggining (from range) of the port range block for the leaf access port block.
required: yes required: yes
aliases: [ from_port_range ] aliases: [ fromPort, from_port_range ]
toPort: to:
description: description:
- The end (to range) of the port range block for the leaf access port block. - The end (to range) of the port range block for the leaf access port block.
required: yes required: yes
aliases: [ to_port_range ] aliases: [ toPort, to_port_range ]
policy_group: policy_group:
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.
@ -70,8 +78,8 @@ EXAMPLES = r'''
leaf_interface_profile: leafintprfname leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname leaf_port_blk: leafportblkname
fromPort: 13 from: 13
toPort: 16 to: 16
policy_group: policygroupname policy_group: policygroupname
state: present state: present
@ -83,8 +91,8 @@ EXAMPLES = r'''
leaf_interface_profile: leafintprfname leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname leaf_port_blk: leafportblkname
fromPort: 13 from: 13
toPort: 16 to: 16
state: present state: present
- name: Remove an interface access port selector associated with an Interface Policy Leaf Profile - name: Remove an interface access port selector associated with an Interface Policy Leaf Profile
@ -116,15 +124,17 @@ from ansible.module_utils.basic import AnsibleModule
def main(): def main():
argument_spec = aci_argument_spec argument_spec = aci_argument_spec
argument_spec.update( argument_spec.update({
leaf_interface_profile=dict(type='str', aliases=['leaf_interface_profile_name']), 'leaf_interface_profile': dict(type='str', aliases=['leaf_interface_profile_name']),
access_port_selector=dict(type='str', aliases=['name', 'access_port_selector_name']), 'access_port_selector': dict(type='str', aliases=['name', 'access_port_selector_name']),
leaf_port_blk=dict(type='str', aliases=['leaf_port_blk_name']), 'description': dict(typ='str'),
fromPort=dict(type='str', aliases=['from_port_range']), 'leaf_port_blk': dict(type='str', aliases=['leaf_port_blk_name']),
toPort=dict(type='str', aliases=['to_port_range']), 'leaf_port_blk_description': dict(type='str'),
policy_group=dict(type='str', aliases=['policy_group_name']), 'from': dict(type='str', aliases=['fromPort', 'from_port_range']),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']), 'to': dict(type='str', aliases=['toPort', 'to_port_range']),
) 'policy_group': dict(type='str', aliases=['policy_group_name']),
'state': dict(type='str', default='present', choices=['absent', 'present', 'query']),
})
module = AnsibleModule( module = AnsibleModule(
argument_spec=argument_spec, argument_spec=argument_spec,
@ -137,9 +147,11 @@ def main():
leaf_interface_profile = module.params['leaf_interface_profile'] leaf_interface_profile = module.params['leaf_interface_profile']
access_port_selector = module.params['access_port_selector'] access_port_selector = module.params['access_port_selector']
description = module.params['description']
leaf_port_blk = module.params['leaf_port_blk'] leaf_port_blk = module.params['leaf_port_blk']
fromPort = module.params['fromPort'] leaf_port_blk_description = module.params['leaf_port_blk_description']
toPort = module.params['toPort'] from_ = module.params['from']
to_ = module.params['to']
policy_group = module.params['policy_group'] policy_group = module.params['policy_group']
state = module.params['state'] state = module.params['state']
@ -167,11 +179,27 @@ def main():
aci.payload( aci.payload(
aci_class='infraHPortS', aci_class='infraHPortS',
class_config=dict( class_config=dict(
descr=description,
name=access_port_selector, name=access_port_selector,
), ),
child_configs=[ child_configs=[
dict(infraPortBlk=dict(attributes=dict(name=leaf_port_blk, fromPort=fromPort, toPort=toPort))), dict(
dict(infraRsAccBaseGrp=dict(attributes=dict(tDn='uni/infra/funcprof/accportgrp-{0}'.format(policy_group)))), infraPortBlk=dict(
attributes=dict(
descr=leaf_port_blk_description,
name=leaf_port_blk,
fromPort=from_,
toPort=to_,
)
)
),
dict(
infraRsAccBaseGrp=dict(
attributes=dict(
tDn='uni/infra/funcprof/accportgrp-{0}'.format(policy_group),
)
)
),
], ],
) )