Skip to content

Commit 614c89f

Browse files
committed
[ignore] Added namespace and collection to see also note in docs of l4l7 device modules
1 parent 0bd3e88 commit 614c89f

File tree

7 files changed

+140
-18
lines changed

7 files changed

+140
-18
lines changed

plugins/modules/aci_l4l7_concrete_device.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
- cisco.aci.aci
5353
- cisco.aci.annotation
5454
notes:
55-
- The I(tenant) and I(device) must exist before using this module in your playbook.
55+
- The I(tenant) and I(logical_device) must exist before using this module in your playbook.
5656
The M(cisco.aci.aci_tenant) and M(cisco.aci.aci_l4l7_device) modules can be used for this.
5757
seealso:
58-
- module: aci_tenant
59-
- module: aci_l4l7_device
58+
- module: cisco.aci.aci_tenant
59+
- module: cisco.aci.aci_l4l7_device
6060
- name: APIC Management Information Model reference
6161
description: More information about the internal APIC class B(vns:CDev)
6262
link: https://developer.cisco.com/docs/apic-mim-ref/

plugins/modules/aci_l4l7_concrete_interface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@
7070
- cisco.aci.aci
7171
- cisco.aci.annotation
7272
notes:
73-
- The I(tenant), I(device) and I(concrete_device) must exist before using this module in your playbook.
73+
- The I(tenant), I(logical_device) and I(concrete_device) must exist before using this module in your playbook.
7474
The M(cisco.aci.aci_tenant), M(cisco.aci.aci_l4l7_device) and M(cisco.aci.aci_l4l7_concrete_device) modules can be used for this.
7575
seealso:
76-
- module: aci_l4l7_device
77-
- module: aci_l4l7_concrete_device
76+
- module: cisco.aci.aci_l4l7_device
77+
- module: cisco.aci.aci_l4l7_concrete_device
7878
- name: APIC Management Information Model reference
7979
description: More information about the internal APIC class B(vns:CIf)
8080
link: https://developer.cisco.com/docs/apic-mim-ref/

plugins/modules/aci_l4l7_concrete_interface_attachment.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
- cisco.aci.aci
5353
- cisco.aci.annotation
5454
notes:
55-
- The I(tenant), I(device), I(logical_interface) and I(concrete_device) must exist before using this module in your playbook.
55+
- The I(tenant), I(logical_device), I(logical_interface) and I(concrete_device) must exist before using this module in your playbook.
5656
The M(cisco.aci.aci_tenant), M(cisco.aci.aci_l4l7_device), M(cisco.aci.aci_l4l7_logical_interface)
5757
and M(cisco.aci.aci_l4l7_concrete_device) modules can be used for this.
5858
seealso:
59-
- module: aci_tenant
60-
- module: aci_l4l7_device
61-
- module: aci_l4l7_logical_interface
62-
- module: aci_l4l7_concrete_device
63-
- module: aci_l4l7_concrete_interface
59+
- module: cisco.aci.aci_tenant
60+
- module: cisco.aci.aci_l4l7_device
61+
- module: cisco.aci.aci_l4l7_logical_interface
62+
- module: cisco.aci.aci_l4l7_concrete_device
63+
- module: cisco.aci.aci_l4l7_concrete_interface
6464
- name: APIC Management Information Model reference
6565
description: More information about the internal APIC class B(vns:RsCIfAttN)
6666
link: https://developer.cisco.com/docs/apic-mim-ref/

plugins/modules/aci_l4l7_device.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@
7676
- The domain to bind to the device.
7777
- The type of domain is controlled by the device_type setting.
7878
type: str
79+
active_active_mode:
80+
description:
81+
- The active active mode on the device.
82+
- This is only applicable when C(function_type="l1") or C(function_type="l2").
83+
- The APIC defaults to C(false) when unset during creation.
84+
type: bool
7985
state:
8086
description:
8187
- Use C(present) or C(absent) for adding or removing.
@@ -90,7 +96,7 @@
9096
- The I(tenant) must exist before using this module in your playbook.
9197
The M(cisco.aci.aci_tenant) modules can be used for this.
9298
seealso:
93-
- module: aci_tenant
99+
- module: cisco.aci.aci_tenant
94100
- name: APIC Management Information Model reference
95101
description: More information about the internal APIC class B(vns:LDevVip)
96102
link: https://developer.cisco.com/docs/apic-mim-ref/
@@ -275,6 +281,7 @@ def main():
275281
service_type=dict(type="str", aliases=["svc_type"], choices=["adc", "fw", "others"]),
276282
trunking=dict(type="bool"),
277283
domain=dict(type="str"),
284+
active_active_mode=dict(type="bool"),
278285
)
279286

280287
module = AnsibleModule(
@@ -299,6 +306,7 @@ def main():
299306
service_type = module.params.get("service_type")
300307
trunking = aci.boolean(module.params.get("trunking"))
301308
domain = module.params.get("domain")
309+
active_active_mode = aci.boolean(module.params.get("active_active_mode"))
302310

303311
aci.construct_url(
304312
root_class=dict(
@@ -339,6 +347,7 @@ def main():
339347
promMode=promiscuous_mode,
340348
svcType=service_type.upper(),
341349
trunking=trunking,
350+
activeActive=active_active_mode,
342351
),
343352
child_configs=child_configs,
344353
)

plugins/modules/aci_l4l7_logical_interface.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
- The encapsulation of the Logical Interface.
3939
- It requires the VLAN to be prepended, for example, 'vlan-987'.
4040
type: str
41+
enhanced_lag_policy:
42+
description:
43+
- Name of the VMM Domain Enhanced Lag Policy.
44+
type: str
45+
aliases: [ lag_policy ]
4146
state:
4247
description:
4348
- Use C(present) or C(absent) for adding or removing.
@@ -49,10 +54,11 @@
4954
- cisco.aci.aci
5055
- cisco.aci.annotation
5156
notes:
52-
- The I(tenant) and I(device) must exist before using this module in your playbook.
57+
- The I(tenant) and I(logical_device) must exist before using this module in your playbook.
5358
The M(cisco.aci.aci_tenant) and M(cisco.aci.aci_l4l7_device) modules can be used for this.
5459
seealso:
55-
- module: aci_l4l7_device
60+
- module: cisco.aci.aci_tenant
61+
- module: cisco.aci.aci_l4l7_device
5662
- name: APIC Management Information Model reference
5763
description: More information about the internal APIC class B(vns:LIf)
5864
link: https://developer.cisco.com/docs/apic-mim-ref/
@@ -226,6 +232,7 @@ def main():
226232
logical_interface=dict(type="str", aliases=["name"]),
227233
state=dict(type="str", default="present", choices=["absent", "present", "query"]),
228234
encap=dict(type="str"),
235+
enhanced_lag_policy=dict(type="str", aliases=["lag_policy"]),
229236
)
230237

231238
module = AnsibleModule(
@@ -242,6 +249,7 @@ def main():
242249
logical_device = module.params.get("logical_device")
243250
logical_interface = module.params.get("logical_interface")
244251
encap = module.params.get("encap")
252+
enhanced_lag_policy = module.params.get("enhanced_lag_policy")
245253

246254
aci = ACIModule(module)
247255

@@ -271,7 +279,7 @@ def main():
271279
if state == "present":
272280
aci.payload(
273281
aci_class="vnsLIf",
274-
class_config=dict(name=logical_interface, encap=encap),
282+
class_config=dict(name=logical_interface, encap=encap, lagPolicyName=enhanced_lag_policy),
275283
)
276284
aci.get_diff(aci_class="vnsLIf")
277285

tests/integration/targets/aci_l4l7_device/tasks/main.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,30 @@
206206
that:
207207
- update_l4l7_device.current.0.vnsLDevVip.children.0.vnsRsALDevToPhysDomP.attributes.tDn == "uni/phys-ansible_phys_dom"
208208

209+
- name: Create another L4-L7 device to test active active mode
210+
cisco.aci.aci_l4l7_device:
211+
<<: *aci_info
212+
tenant: ansible_tenant
213+
device: ansible_device2
214+
domain: ansible_phys_dom
215+
func_type: l1
216+
context_aware: multi
217+
managed: false
218+
dev_type: physical
219+
svc_type: others
220+
trunking: true
221+
prom_mode: false
222+
active_active_mode: true
223+
state: present
224+
register: another_l4l7_device_active
225+
226+
- name: Verify domain binding object
227+
ansible.builtin.assert:
228+
that:
229+
- another_l4l7_device_active is changed
230+
- another_l4l7_device_active.current.0.vnsLDevVip.attributes.funcType == "L1"
231+
- another_l4l7_device_active.current.0.vnsLDevVip.attributes.activeActive == "yes"
232+
209233
# QUERY DEVICE
210234
- name: Query L4-L7 Device
211235
cisco.aci.aci_l4l7_device:
@@ -240,7 +264,7 @@
240264
ansible.builtin.assert:
241265
that:
242266
- query_l4l7_device_all is not changed
243-
- query_l4l7_device_all.current | length >= 2
267+
- query_l4l7_device_all.current | length >= 3
244268
- "'uni/tn-ansible_tenant/lDevVip-ansible_device' in query_l4l7_device_all.current | map(attribute='vnsLDevVip.attributes.dn') | list"
245269
- "'uni/tn-ansible_tenant/lDevVip-ansible_virt_device' in query_l4l7_device_all.current | map(attribute='vnsLDevVip.attributes.dn') | list"
246270

tests/integration/targets/aci_l4l7_logical_interface/tasks/main.yml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
domain_type: phys
3636
state: absent
3737

38+
- name: Remove ansible_vmm_domain if it already exists
39+
cisco.aci.aci_domain:
40+
<<: *aci_info
41+
domain: ansible_vmm_dom
42+
domain_type: vmm
43+
vm_provider: vmware
44+
state: absent
45+
3846
# CREATE TENANT
3947
- name: Create ansible_tenant
4048
cisco.aci.aci_tenant:
@@ -50,6 +58,14 @@
5058
domain_type: phys
5159
state: present
5260

61+
- name: Create ansible_vmm_domain
62+
cisco.aci.aci_domain:
63+
<<: *aci_info
64+
domain: ansible_vmm_dom
65+
domain_type: vmm
66+
vm_provider: vmware
67+
state: present
68+
5369
# CREATE L4-L7 LOGICAL DEVICE
5470
- name: Create L4-L7 Device
5571
cisco.aci.aci_l4l7_device:
@@ -66,6 +82,21 @@
6682
prom_mode: true
6783
state: present
6884

85+
- name: Create L4-L7 Virtual Device
86+
cisco.aci.aci_l4l7_device:
87+
<<: *aci_info
88+
tenant: ansible_tenant
89+
device: ansible_virt_device
90+
domain: ansible_vmm_dom
91+
func_type: go_to
92+
context_aware: single
93+
managed: false
94+
dev_type: virtual
95+
svc_type: adc
96+
trunking: false
97+
prom_mode: true
98+
state: present
99+
69100
# CREATE L4-L7 LOGICAL INTERFACE
70101
- name: Add Logical Interface in check mode
71102
cisco.aci.aci_l4l7_logical_interface: &l4l7_logical_interface
@@ -122,6 +153,48 @@
122153
- update_logical_interface.current.0.vnsLIf.attributes.name == "ansible_log_intf"
123154
- update_logical_interface.current.0.vnsLIf.attributes.encap == "vlan-988"
124155

156+
# Test to verify enhanced_lag_policy
157+
- name: Create enhanced lag policy
158+
cisco.aci.aci_rest:
159+
<<: *aci_info
160+
path: api/node/mo/uni/vmmp-VMware/dom-ansible_vmm_dom/vswitchpolcont.json
161+
method: post
162+
content: |
163+
{
164+
"vmmVSwitchPolicyCont": {
165+
"attributes": {
166+
"dn": "uni/vmmp-VMware/dom-ansible_vmm_dom/vswitchpolcont",
167+
"status": "created,modified"
168+
},
169+
"children": [{
170+
"lacpEnhancedLagPol": {
171+
"attributes": {
172+
"lbmode": "src-dst-ip",
173+
"mode": "active",
174+
"name": "enhanced",
175+
"numLinks": "2"
176+
}
177+
}
178+
}]
179+
}
180+
}
181+
182+
- name: Add Logical Interface for virtual device
183+
cisco.aci.aci_l4l7_logical_interface:
184+
<<: *aci_info
185+
tenant: ansible_tenant
186+
device: ansible_virt_device
187+
logical_interface: ansible_virt
188+
lag_policy: enhanced
189+
state: present
190+
register: add_logical_interface_virtual
191+
192+
- name: Verify Logical Interface Virtual
193+
ansible.builtin.assert:
194+
that:
195+
- add_logical_interface_virtual is changed
196+
- add_logical_interface_virtual.current.0.vnsLIf.attributes.lagPolicyName == "enhanced"
197+
125198
# QUERY L4-L7 LOGICAL INTERFACE
126199
- name: Create a second L4-L7 Logical Interface for query all
127200
cisco.aci.aci_l4l7_logical_interface:
@@ -153,7 +226,7 @@
153226
- query_logical_interface is not changed
154227
- query_logical_interface.current.0.vnsLIf.attributes.dn == "uni/tn-ansible_tenant/lDevVip-ansible_device/lIf-ansible_log_intf"
155228
- query_logical_interface.current.0.vnsLIf.attributes.name == "ansible_log_intf"
156-
- query_all.current | length >= 2
229+
- query_all.current | length >= 3
157230
- "'uni/tn-ansible_tenant/lDevVip-ansible_device/lIf-ansible_log_intf' in query_all.current | map(attribute='vnsLIf.attributes.dn') | list"
158231
- "'uni/tn-ansible_tenant/lDevVip-ansible_device/lIf-ansible_log_int2' in query_all.current | map(attribute='vnsLIf.attributes.dn') | list"
159232
- query_logical_interface.current.0.vnsLIf.attributes.encap == "vlan-988"
@@ -205,3 +278,11 @@
205278
domain: ansible_phys_dom
206279
domain_type: phys
207280
state: absent
281+
282+
- name: Remove ansible_vmm_domain if it already exists
283+
cisco.aci.aci_domain:
284+
<<: *aci_info
285+
domain: ansible_vmm_dom
286+
domain_type: vmm
287+
vm_provider: vmware
288+
state: absent

0 commit comments

Comments
 (0)