ACI_SWITCH_LEAF_SELECTOR: Add description options (#34841)

pull/34852/head
Jacob McGill 7 years ago committed by ansibot
parent aa9fc9313f
commit 002fad53a1

@ -26,36 +26,42 @@ notes:
- This module is to be used with M(aci_switch_policy_leaf_profile) - This module is to be used with M(aci_switch_policy_leaf_profile)
One first creates a leaf profile (infra:NodeP) and then creates an associated selector (infra:LeafS), One first creates a leaf profile (infra:NodeP) and then creates an associated selector (infra:LeafS),
options: options:
leaf_profile: description:
description: description:
- Name of the Leaf Profile to which we add a Selector. - The description to assign to the C(leaf)
aliases: [ leaf_profile_name ] leaf_profile:
leaf: description:
description: - Name of the Leaf Profile to which we add a Selector.
- Name of Leaf Selector. aliases: [ leaf_profile_name ]
aliases: [ name, leaf_name, leaf_profile_leaf_name, leaf_selector_name ] leaf:
leaf_node_blk: description:
description: - Name of Leaf Selector.
- Name of Node Block range to be added to Leaf Selector of given Leaf Profile aliases: [ name, leaf_name, leaf_profile_leaf_name, leaf_selector_name ]
aliases: [ leaf_node_blk_name, node_blk_name ] leaf_node_blk:
from: description:
description: - Name of Node Block range to be added to Leaf Selector of given Leaf Profile
- Start of Node Block Range aliases: [ leaf_node_blk_name, node_blk_name ]
aliases: [ node_blk_range_from, from_range, range_from ] leaf_node_blk_description:
to: description:
description: - The description to assign to the C(leaf_node_blk)
- Start of Node Block Range from:
aliases: [ node_blk_range_to, to_range, range_to ] description:
policy_group: - Start of Node Block Range
description: aliases: [ node_blk_range_from, from_range, range_from ]
- Name of the Policy Group to be added to Leaf Selector of given Leaf Profile to:
aliases: [ name, policy_group_name ] description:
state: - Start of Node Block Range
description: aliases: [ node_blk_range_to, to_range, range_to ]
- Use C(present) or C(absent) for adding or removing. policy_group:
- Use C(query) for listing an object or multiple objects. description:
choices: [ absent, present, query ] - Name of the Policy Group to be added to Leaf Selector of given Leaf Profile
default: present aliases: [ name, policy_group_name ]
state:
description:
- Use C(present) or C(absent) for adding or removing.
- Use C(query) for listing an object or multiple objects.
choices: [ absent, present, query ]
default: present
''' '''
EXAMPLES = r''' EXAMPLES = r'''
@ -112,13 +118,15 @@ 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({
'description': dict(type='str'),
'leaf_profile': dict(type='str', aliases=['leaf_profile_name']), 'leaf_profile': dict(type='str', aliases=['leaf_profile_name']),
'leaf': dict(type='str', aliases=['name', 'leaf_name', 'leaf_profile_leaf_name', 'leaf_selector_name']), 'leaf': dict(type='str', aliases=['name', 'leaf_name', 'leaf_profile_leaf_name', 'leaf_selector_name']),
'leaf_node_blk': dict(type='str', aliases=['leaf_node_blk_name', 'node_blk_name']), 'leaf_node_blk': dict(type='str', aliases=['leaf_node_blk_name', 'node_blk_name']),
'leaf_node_blk_description': dict(type='str'),
'from': dict(type='int', aliases=['node_blk_range_from', 'from_range', 'range_from']), 'from': dict(type='int', aliases=['node_blk_range_from', 'from_range', 'range_from']),
'to': dict(type='int', aliases=['node_blk_range_to', 'to_range', 'range_to']), 'to': dict(type='int', aliases=['node_blk_range_to', 'to_range', 'range_to']),
'policy_group': dict(type='str', aliases=['policy_group_name']), 'policy_group': dict(type='str', aliases=['policy_group_name']),
'state': dict(type='str', default='present', choices=['absent', 'present', 'query']) 'state': dict(type='str', default='present', choices=['absent', 'present', 'query']),
}) })
module = AnsibleModule( module = AnsibleModule(
@ -130,9 +138,11 @@ def main():
] ]
) )
description = module.params['description']
leaf_profile = module.params['leaf_profile'] leaf_profile = module.params['leaf_profile']
leaf = module.params['leaf'] leaf = module.params['leaf']
leaf_node_blk = module.params['leaf_node_blk'] leaf_node_blk = module.params['leaf_node_blk']
leaf_node_blk_description = module.params['leaf_node_blk_description']
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']
@ -165,11 +175,27 @@ def main():
aci.payload( aci.payload(
aci_class='infraLeafS', aci_class='infraLeafS',
class_config=dict( class_config=dict(
name=leaf descr=description,
name=leaf,
), ),
child_configs=[ child_configs=[
dict(infraNodeBlk=dict(attributes=dict(name=leaf_node_blk, from_=from_, to_=to_))), dict(
dict(infraRsAccNodePGrp=dict(attributes=dict(tDn='uni/infra/funcprof/accnodepgrp-{0}'.format(policy_group)))), infraNodeBlk=dict(
attributes=dict(
descr=leaf_node_blk_description,
name=leaf_node_blk,
from_=from_,
to_=to_,
)
)
),
dict(
infraRsAccNodePGrp=dict(
attributes=dict(
tDn='uni/infra/funcprof/accnodepgrp-{0}'.format(policy_group),
)
)
),
], ],
) )

Loading…
Cancel
Save