Pathatt encap (#35803)
* ACI_STATIC_BINDING: Rename 'encap' parameters * Capitilize 'c' in docstring * replicate name change in 'required_if'pull/4420/head
parent
f20b9dab72
commit
76a6c59e35
|
@ -38,17 +38,18 @@ options:
|
||||||
description:
|
description:
|
||||||
- The name of the end point group.
|
- The name of the end point group.
|
||||||
aliases: [ epg_name ]
|
aliases: [ epg_name ]
|
||||||
encap:
|
encap_id:
|
||||||
description:
|
description:
|
||||||
- The VLAN encapsulation for the EPG.
|
- The encapsulation ID associating the C(epg) with the interface path.
|
||||||
- This acts as the secondary encap when using useg.
|
- This acts as the secondary C(encap_id) when using micro-segmentation.
|
||||||
aliases: [ encapsulation ]
|
aliases: [ vlan, vlan_id ]
|
||||||
choices: [ range from 1 to 4096 ]
|
choices: [ Valid encap IDs for specified encap, currently 1 to 4096 ]
|
||||||
primary_encap:
|
primary_encap_id:
|
||||||
description:
|
description:
|
||||||
- Determines the primary VLAN ID when using useg.
|
- Determines the primary encapsulation ID associating the C(epg)
|
||||||
aliases: [ primary_encapsulation ]
|
with the interface path when using micro-segmentation.
|
||||||
choices: [ range from 1 to 4096 ]
|
aliases: [ primary_vlan, primary_vlan_id ]
|
||||||
|
choices: [ Valid encap IDs for specified encap, currently 1 to 4096 ]
|
||||||
deploy_immediacy:
|
deploy_immediacy:
|
||||||
description:
|
description:
|
||||||
- The Deployement Immediacy of Static EPG on PC, VPC or Interface.
|
- The Deployement Immediacy of Static EPG on PC, VPC or Interface.
|
||||||
|
@ -98,7 +99,7 @@ extends_documentation_fragment: aci
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r'''
|
||||||
- name: Deploy Static EPG (Port Channel)
|
- name: Deploy Static Path for EPG
|
||||||
aci_static_binding_to_epg:
|
aci_static_binding_to_epg:
|
||||||
host: apic
|
host: apic
|
||||||
username: admin
|
username: admin
|
||||||
|
@ -106,15 +107,13 @@ EXAMPLES = r'''
|
||||||
tenant: accessport-code-cert
|
tenant: accessport-code-cert
|
||||||
ap: accessport_code_app
|
ap: accessport_code_app
|
||||||
epg: accessport_epg1
|
epg: accessport_epg1
|
||||||
encap: 222
|
encap_id: 222
|
||||||
# primary_encap: 11
|
|
||||||
deploy_immediacy: lazy
|
deploy_immediacy: lazy
|
||||||
interface_mode: access
|
interface_mode: access
|
||||||
interface_type: switch_port
|
interface_type: switch_port
|
||||||
pod: 1
|
pod: 1
|
||||||
leafs: 101
|
leafs: 101
|
||||||
interface: '1/7'
|
interface: '1/7'
|
||||||
# extpaths: 1011
|
|
||||||
state: present
|
state: present
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -134,8 +133,8 @@ def main():
|
||||||
tenant=dict(type='str', aliases=['tenant_name']),
|
tenant=dict(type='str', aliases=['tenant_name']),
|
||||||
ap=dict(type='str', aliases=['app_profile', 'app_profile_name']),
|
ap=dict(type='str', aliases=['app_profile', 'app_profile_name']),
|
||||||
epg=dict(type='str', aliases=['epg_name']),
|
epg=dict(type='str', aliases=['epg_name']),
|
||||||
encap=dict(type='int', aliases=['encapsulation']),
|
encap_id=dict(type='int', aliases=['vlan', 'vlan_id']),
|
||||||
primary_encap=dict(type='int', aliases=['primary_encapsulation']),
|
primary_encap_id=dict(type='int', aliases=['primary_vlan', 'primary_vlan_id']),
|
||||||
deploy_immediacy=dict(type='str', choices=['immediate', 'lazy']),
|
deploy_immediacy=dict(type='str', choices=['immediate', 'lazy']),
|
||||||
interface_mode=dict(type='str', choices=['access', 'tagged', '802.1p'], aliases=['mode', 'interface_mode_name']),
|
interface_mode=dict(type='str', choices=['access', 'tagged', '802.1p'], aliases=['mode', 'interface_mode_name']),
|
||||||
interface_type=dict(type='str', choices=['switch_port', 'vpc', 'port_channel', 'fex'], required=True),
|
interface_type=dict(type='str', choices=['switch_port', 'vpc', 'port_channel', 'fex'], required=True),
|
||||||
|
@ -155,7 +154,7 @@ def main():
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
required_if=[
|
required_if=[
|
||||||
['state', 'absent', ['tenant', 'ap', 'epg', 'interface_type', 'pod', 'leafs', 'interface']],
|
['state', 'absent', ['tenant', 'ap', 'epg', 'interface_type', 'pod', 'leafs', 'interface']],
|
||||||
['state', 'present', ['tenant', 'ap', 'epg', 'encap', 'interface_type', 'pod', 'leafs', 'interface']],
|
['state', 'present', ['tenant', 'ap', 'epg', 'encap_id', 'interface_type', 'pod', 'leafs', 'interface']],
|
||||||
['interface_type', 'fex', ['extpaths']],
|
['interface_type', 'fex', ['extpaths']],
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -163,8 +162,8 @@ def main():
|
||||||
tenant = module.params['tenant']
|
tenant = module.params['tenant']
|
||||||
ap = module.params['ap']
|
ap = module.params['ap']
|
||||||
epg = module.params['epg']
|
epg = module.params['epg']
|
||||||
encap = module.params['encap']
|
encap_id = module.params['encap_id']
|
||||||
primary_encap = module.params['primary_encap']
|
primary_encap_id = module.params['primary_encap_id']
|
||||||
deploy_immediacy = module.params['deploy_immediacy']
|
deploy_immediacy = module.params['deploy_immediacy']
|
||||||
interface_mode = module.params['interface_mode']
|
interface_mode = module.params['interface_mode']
|
||||||
interface_type = module.params['interface_type']
|
interface_type = module.params['interface_type']
|
||||||
|
@ -190,15 +189,15 @@ def main():
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
static_path = ''
|
static_path = ''
|
||||||
|
|
||||||
if encap is not None:
|
if encap_id is not None:
|
||||||
if encap in range(1, 4097):
|
if encap_id in range(1, 4097):
|
||||||
encap = 'vlan-{0}'.format(encap)
|
encap_id = 'vlan-{0}'.format(encap_id)
|
||||||
else:
|
else:
|
||||||
module.fail_json(msg='Valid VLAN assigments are from 1 to 4096')
|
module.fail_json(msg='Valid VLAN assigments are from 1 to 4096')
|
||||||
|
|
||||||
if primary_encap is not None:
|
if primary_encap_id is not None:
|
||||||
if primary_encap in range(1, 4097):
|
if primary_encap_id in range(1, 4097):
|
||||||
primary_encap = 'vlan-{0}'.format(primary_encap)
|
primary_encap_id = 'vlan-{0}'.format(primary_encap_id)
|
||||||
else:
|
else:
|
||||||
module.fail_json(msg='Valid VLAN assigments are from 1 to 4096')
|
module.fail_json(msg='Valid VLAN assigments are from 1 to 4096')
|
||||||
|
|
||||||
|
@ -250,8 +249,8 @@ def main():
|
||||||
aci.payload(
|
aci.payload(
|
||||||
aci_class='fvRsPathAtt',
|
aci_class='fvRsPathAtt',
|
||||||
class_config=dict(
|
class_config=dict(
|
||||||
encap=encap,
|
encap=encap_id,
|
||||||
primaryEncap=primary_encap,
|
primaryEncap=primary_encap_id,
|
||||||
instrImedcy=deploy_immediacy,
|
instrImedcy=deploy_immediacy,
|
||||||
mode=interface_mode,
|
mode=interface_mode,
|
||||||
tDn=static_path,
|
tDn=static_path,
|
||||||
|
|
Loading…
Reference in New Issue