mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ACI_SWITCH_LEAF_SELECTOR: Add description options (#34841)
This commit is contained in:
parent
aa9fc9313f
commit
002fad53a1
1 changed files with 60 additions and 34 deletions
|
@ -26,6 +26,9 @@ notes:
|
|||
- 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),
|
||||
options:
|
||||
description:
|
||||
description:
|
||||
- The description to assign to the C(leaf)
|
||||
leaf_profile:
|
||||
description:
|
||||
- Name of the Leaf Profile to which we add a Selector.
|
||||
|
@ -38,6 +41,9 @@ options:
|
|||
description:
|
||||
- Name of Node Block range to be added to Leaf Selector of given Leaf Profile
|
||||
aliases: [ leaf_node_blk_name, node_blk_name ]
|
||||
leaf_node_blk_description:
|
||||
description:
|
||||
- The description to assign to the C(leaf_node_blk)
|
||||
from:
|
||||
description:
|
||||
- Start of Node Block Range
|
||||
|
@ -112,13 +118,15 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
def main():
|
||||
argument_spec = aci_argument_spec
|
||||
argument_spec.update({
|
||||
'description': dict(type='str'),
|
||||
'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_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']),
|
||||
'to': dict(type='int', aliases=['node_blk_range_to', 'to_range', 'range_to']),
|
||||
'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(
|
||||
|
@ -130,9 +138,11 @@ def main():
|
|||
]
|
||||
)
|
||||
|
||||
description = module.params['description']
|
||||
leaf_profile = module.params['leaf_profile']
|
||||
leaf = module.params['leaf']
|
||||
leaf_node_blk = module.params['leaf_node_blk']
|
||||
leaf_node_blk_description = module.params['leaf_node_blk_description']
|
||||
from_ = module.params['from']
|
||||
to_ = module.params['to']
|
||||
policy_group = module.params['policy_group']
|
||||
|
@ -165,11 +175,27 @@ def main():
|
|||
aci.payload(
|
||||
aci_class='infraLeafS',
|
||||
class_config=dict(
|
||||
name=leaf
|
||||
descr=description,
|
||||
name=leaf,
|
||||
),
|
||||
child_configs=[
|
||||
dict(infraNodeBlk=dict(attributes=dict(name=leaf_node_blk, from_=from_, to_=to_))),
|
||||
dict(infraRsAccNodePGrp=dict(attributes=dict(tDn='uni/infra/funcprof/accnodepgrp-{0}'.format(policy_group)))),
|
||||
dict(
|
||||
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…
Reference in a new issue