|
|
@ -45,27 +45,36 @@ options:
|
|
|
|
leaf_port_blk_description:
|
|
|
|
leaf_port_blk_description:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- The description to assign to the C(leaf_port_blk)
|
|
|
|
- The description to assign to the C(leaf_port_blk)
|
|
|
|
required: no
|
|
|
|
from_port:
|
|
|
|
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.
|
|
|
|
|
|
|
|
aliases: [ from, fromPort, from_port_range ]
|
|
|
|
required: yes
|
|
|
|
required: yes
|
|
|
|
aliases: [ fromPort, from_port_range ]
|
|
|
|
to_port:
|
|
|
|
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.
|
|
|
|
|
|
|
|
aliases: [ to, toPort, to_port_range ]
|
|
|
|
required: yes
|
|
|
|
required: yes
|
|
|
|
aliases: [ toPort, to_port_range ]
|
|
|
|
from_card:
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
- The beggining (from range) of the card range block for the leaf access port block.
|
|
|
|
|
|
|
|
aliases: [ from_card_range ]
|
|
|
|
|
|
|
|
version_added: '2.6'
|
|
|
|
|
|
|
|
to_card:
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
- The end (to range) of the card range block for the leaf access port block.
|
|
|
|
|
|
|
|
aliases: [ to_card_range ]
|
|
|
|
|
|
|
|
version_added: '2.6'
|
|
|
|
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.
|
|
|
|
aliases: [ policy_group_name ]
|
|
|
|
aliases: [ policy_group_name ]
|
|
|
|
interface_type:
|
|
|
|
interface_type:
|
|
|
|
version_added: '2.6'
|
|
|
|
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- The type of interface for the static EPG deployement.
|
|
|
|
- The type of interface for the static EPG deployement.
|
|
|
|
choices: [ fex, port_channel, switch_port, vpc ]
|
|
|
|
choices: [ fex, port_channel, switch_port, vpc ]
|
|
|
|
default: switch_port
|
|
|
|
default: switch_port
|
|
|
|
|
|
|
|
version_added: '2.6'
|
|
|
|
state:
|
|
|
|
state:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Use C(present) or C(absent) for adding or removing.
|
|
|
|
- Use C(present) or C(absent) for adding or removing.
|
|
|
@ -84,8 +93,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
|
|
|
|
from: 13
|
|
|
|
from_port: 13
|
|
|
|
to: 16
|
|
|
|
toi_port: 16
|
|
|
|
policy_group: policygroupname
|
|
|
|
policy_group: policygroupname
|
|
|
|
state: present
|
|
|
|
state: present
|
|
|
|
|
|
|
|
|
|
|
@ -97,8 +106,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
|
|
|
|
from: 13
|
|
|
|
from_port: 13
|
|
|
|
to: 16
|
|
|
|
to_port: 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
|
|
|
@ -231,19 +240,20 @@ 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']), # Not required for querying all objects
|
|
|
|
leaf_interface_profile=dict(type='str', aliases=['leaf_interface_profile_name']), # Not required for querying all objects
|
|
|
|
'access_port_selector': dict(type='str', aliases=['name', 'access_port_selector_name']), # Not required for querying all objects
|
|
|
|
access_port_selector=dict(type='str', aliases=['name', 'access_port_selector_name']), # Not required for querying all objects
|
|
|
|
'description': dict(typ='str'),
|
|
|
|
description=dict(typ='str'),
|
|
|
|
'leaf_port_blk': dict(type='str', aliases=['leaf_port_blk_name']),
|
|
|
|
leaf_port_blk=dict(type='str', aliases=['leaf_port_blk_name']),
|
|
|
|
'leaf_port_blk_description': dict(type='str'),
|
|
|
|
leaf_port_blk_description=dict(type='str'),
|
|
|
|
# NOTE: Keyword 'from' is a reserved word in python, so we need it as a string
|
|
|
|
from_port=dict(type='str', aliases=['from', 'fromPort', 'from_port_range']),
|
|
|
|
'from': dict(type='str', aliases=['fromPort', 'from_port_range']),
|
|
|
|
to_port=dict(type='str', aliases=['to', 'toPort', 'to_port_range']),
|
|
|
|
'to': dict(type='str', aliases=['toPort', 'to_port_range']),
|
|
|
|
from_card=dict(type='str', aliases=['from_card_range']),
|
|
|
|
'policy_group': dict(type='str', aliases=['policy_group_name']),
|
|
|
|
to_card=dict(type='str', aliases=['to_card_range']),
|
|
|
|
'interface_type': dict(type='str', default='switch_port', choices=['fex', 'port_channel', 'switch_port', 'vpc']),
|
|
|
|
policy_group=dict(type='str', aliases=['policy_group_name']),
|
|
|
|
'state': dict(type='str', default='present', choices=['absent', 'present', 'query']),
|
|
|
|
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']),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
module = AnsibleModule(
|
|
|
|
module = AnsibleModule(
|
|
|
|
argument_spec=argument_spec,
|
|
|
|
argument_spec=argument_spec,
|
|
|
@ -259,8 +269,10 @@ def main():
|
|
|
|
description = module.params['description']
|
|
|
|
description = module.params['description']
|
|
|
|
leaf_port_blk = module.params['leaf_port_blk']
|
|
|
|
leaf_port_blk = module.params['leaf_port_blk']
|
|
|
|
leaf_port_blk_description = module.params['leaf_port_blk_description']
|
|
|
|
leaf_port_blk_description = module.params['leaf_port_blk_description']
|
|
|
|
from_ = module.params['from']
|
|
|
|
from_port = module.params['from_port']
|
|
|
|
to_ = module.params['to']
|
|
|
|
to_port = module.params['to_port']
|
|
|
|
|
|
|
|
from_card = module.params['from_card']
|
|
|
|
|
|
|
|
to_card = module.params['to_card']
|
|
|
|
policy_group = module.params['policy_group']
|
|
|
|
policy_group = module.params['policy_group']
|
|
|
|
interface_type = module.params['interface_type']
|
|
|
|
interface_type = module.params['interface_type']
|
|
|
|
state = module.params['state']
|
|
|
|
state = module.params['state']
|
|
|
@ -271,7 +283,7 @@ def main():
|
|
|
|
aci_class='infraAccPortP',
|
|
|
|
aci_class='infraAccPortP',
|
|
|
|
aci_rn='infra/accportprof-{0}'.format(leaf_interface_profile),
|
|
|
|
aci_rn='infra/accportprof-{0}'.format(leaf_interface_profile),
|
|
|
|
filter_target='eq(infraAccPortP.name, "{0}")'.format(leaf_interface_profile),
|
|
|
|
filter_target='eq(infraAccPortP.name, "{0}")'.format(leaf_interface_profile),
|
|
|
|
module_object=leaf_interface_profile
|
|
|
|
module_object=leaf_interface_profile,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
subclass_1=dict(
|
|
|
|
subclass_1=dict(
|
|
|
|
aci_class='infraHPortS',
|
|
|
|
aci_class='infraHPortS',
|
|
|
@ -280,7 +292,7 @@ def main():
|
|
|
|
filter_target='eq(infraHPortS.name, "{0}")'.format(access_port_selector),
|
|
|
|
filter_target='eq(infraHPortS.name, "{0}")'.format(access_port_selector),
|
|
|
|
module_object=access_port_selector,
|
|
|
|
module_object=access_port_selector,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child_classes=['infraPortBlk', 'infraRsAccBaseGrp']
|
|
|
|
child_classes=['infraPortBlk', 'infraRsAccBaseGrp'],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
INTERFACE_TYPE_MAPPING = dict(
|
|
|
|
INTERFACE_TYPE_MAPPING = dict(
|
|
|
@ -298,6 +310,7 @@ def main():
|
|
|
|
class_config=dict(
|
|
|
|
class_config=dict(
|
|
|
|
descr=description,
|
|
|
|
descr=description,
|
|
|
|
name=access_port_selector,
|
|
|
|
name=access_port_selector,
|
|
|
|
|
|
|
|
# type='range',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child_configs=[
|
|
|
|
child_configs=[
|
|
|
|
dict(
|
|
|
|
dict(
|
|
|
@ -305,8 +318,10 @@ def main():
|
|
|
|
attributes=dict(
|
|
|
|
attributes=dict(
|
|
|
|
descr=leaf_port_blk_description,
|
|
|
|
descr=leaf_port_blk_description,
|
|
|
|
name=leaf_port_blk,
|
|
|
|
name=leaf_port_blk,
|
|
|
|
fromPort=from_,
|
|
|
|
fromPort=from_port,
|
|
|
|
toPort=to_,
|
|
|
|
toPort=to_port,
|
|
|
|
|
|
|
|
fromCard=from_card,
|
|
|
|
|
|
|
|
toCard=to_card,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|