Skip to content

Commit d82a230

Browse files
sajaganalhercot
authored andcommitted
[ignore] Removed name attribute from endpoint_ip_tag and endpoint_mac_tag modules
1 parent 04f1aef commit d82a230

File tree

4 files changed

+30
-64
lines changed

4 files changed

+30
-64
lines changed

plugins/modules/aci_endpoint_ip_tag.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
description:
2222
- The name of the Tenant.
2323
type: str
24-
name:
25-
description:
26-
- The name of the Endpoint IP Tag.
27-
type: str
2824
endpoint_ip_address:
2925
description:
3026
- The IPv4 or IPv6 address of the Endpoint IP Tag.
@@ -71,9 +67,8 @@
7167
username: admin
7268
password: SomeSecretPassword
7369
tenant: endpoint_tenant
74-
endpoint_ip_address: "1.1.1.1"
70+
endpoint_ip_address: 1.1.1.1
7571
vrf: endpoint_vrf
76-
name: "1.1.1.1"
7772
name_alias: endpoint_ip_tag
7873
state: present
7974
@@ -83,9 +78,8 @@
8378
username: admin
8479
password: SomeSecretPassword
8580
tenant: endpoint_tenant
86-
endpoint_ip_address: "1.1.1.1"
81+
endpoint_ip_address: 1.1.1.1
8782
vrf: endpoint_vrf
88-
name: "1.1.1.1"
8983
name_alias: endpoint_ip_tag_updated
9084
state: present
9185
@@ -95,7 +89,7 @@
9589
username: admin
9690
password: SomeSecretPassword
9791
tenant: endpoint_tenant
98-
endpoint_ip_address: "1.1.1.1"
92+
endpoint_ip_address: 1.1.1.1
9993
vrf: endpoint_vrf
10094
state: query
10195
register: query_one
@@ -114,7 +108,7 @@
114108
host: apic
115109
username: admin
116110
password: SomeSecretPassword
117-
endpoint_ip_address: "1.1.1.1"
111+
endpoint_ip_address: 1.1.1.1
118112
state: query
119113
register: query_with_ip
120114
@@ -132,7 +126,7 @@
132126
username: admin
133127
password: SomeSecretPassword
134128
tenant: endpoint_tenant
135-
endpoint_ip_address: "1.1.1.1"
129+
endpoint_ip_address: 1.1.1.1
136130
vrf: endpoint_vrf
137131
state: present
138132
"""
@@ -252,7 +246,6 @@ def main():
252246
argument_spec.update(aci_owner_spec())
253247
argument_spec.update(
254248
tenant=dict(type="str"),
255-
name=dict(type="str"),
256249
endpoint_ip_address=dict(type="str", aliases=["ip_addr", "ip"]),
257250
vrf=dict(type="str", aliases=["vrf_name"]),
258251
name_alias=dict(type="str"),
@@ -273,18 +266,18 @@ def main():
273266
tenant = module.params.get("tenant")
274267
endpoint_ip_address = module.params.get("endpoint_ip_address")
275268
vrf = module.params.get("vrf")
276-
name = module.params.get("name")
277269
name_alias = module.params.get("name_alias")
278270
annotation = module.params.get("annotation")
279271
state = module.params.get("state")
280272

281273
aci = ACIModule(module)
282274

283-
endpoint_ip_tag_rn = None
284-
endpoint_ip_tag_module_object = None
285275
if endpoint_ip_address and vrf:
286-
endpoint_ip_tag_rn = "eptags/epiptag-[{0}]-{1}".format(endpoint_ip_address, vrf)
287276
endpoint_ip_tag_module_object = "[{0}]-{1}".format(endpoint_ip_address, vrf)
277+
endpoint_ip_tag_rn = "eptags/epiptag-{0}".format(endpoint_ip_tag_module_object)
278+
else:
279+
endpoint_ip_tag_rn = None
280+
endpoint_ip_tag_module_object = None
288281

289282
aci.construct_url(
290283
root_class=dict(
@@ -309,7 +302,6 @@ def main():
309302
annotation=annotation,
310303
ctxName=vrf,
311304
ip=endpoint_ip_address,
312-
name=name,
313305
nameAlias=name_alias,
314306
),
315307
)

plugins/modules/aci_endpoint_mac_tag.py

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
description:
2222
- The name of the Tenant.
2323
type: str
24-
name:
25-
description:
26-
- The name of the Endpoint MAC Tag.
27-
type: str
2824
endpoint_mac_address:
2925
description:
3026
- The MAC address of the Endpoint MAC Tag.
@@ -65,25 +61,14 @@
6561
"""
6662

6763
EXAMPLES = r"""
68-
- name: Add a Fabric Leaf Policy Group
69-
cisco.aci.aci_endpoint_mac_tag:
70-
host: apic
71-
username: admin
72-
password: SomeSecretPassword
73-
name: leaf_policy_group
74-
type: leaf
75-
state: present
76-
delegate_to: localhost
77-
7864
- name: Add a MAC Tag
7965
cisco.aci.aci_endpoint_mac_tag:
8066
host: apic
8167
username: admin
8268
password: SomeSecretPassword
8369
tenant: endpoint_tenant
84-
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
70+
endpoint_mac_address: AE:ED:EE:EE:AA:AA
8571
bd: endpoint_bd
86-
name: "AE:ED:EE:EE:AA:AA"
8772
name_alias: endpoint_mac_tag
8873
state: present
8974
@@ -93,9 +78,8 @@
9378
username: admin
9479
password: SomeSecretPassword
9580
tenant: endpoint_tenant
96-
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
81+
endpoint_mac_address: AE:ED:EE:EE:AA:AA
9782
bd: endpoint_bd
98-
name: "AE:ED:EE:EE:AA:AA"
9983
name_alias: endpoint_mac_tag_updated
10084
state: present
10185
@@ -105,7 +89,7 @@
10589
username: admin
10690
password: SomeSecretPassword
10791
tenant: endpoint_tenant
108-
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
92+
endpoint_mac_address: AE:ED:EE:EE:AA:AA
10993
bd: endpoint_bd
11094
state: query
11195
register: query_one
@@ -124,7 +108,7 @@
124108
host: apic
125109
username: admin
126110
password: SomeSecretPassword
127-
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
111+
endpoint_mac_address: AE:ED:EE:EE:AA:AA
128112
state: query
129113
register: query_with_mac
130114
@@ -142,7 +126,7 @@
142126
username: admin
143127
password: SomeSecretPassword
144128
tenant: endpoint_tenant
145-
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
129+
endpoint_mac_address: AE:ED:EE:EE:AA:AA
146130
bd: endpoint_bd
147131
state: absent
148132
"""
@@ -262,7 +246,6 @@ def main():
262246
argument_spec.update(aci_owner_spec())
263247
argument_spec.update(
264248
tenant=dict(type="str"),
265-
name=dict(type="str"),
266249
endpoint_mac_address=dict(type="str", aliases=["mac_addr", "mac"]),
267250
bd=dict(type="str", aliases=["bd_name"]),
268251
name_alias=dict(type="str"),
@@ -283,18 +266,18 @@ def main():
283266
tenant = module.params.get("tenant")
284267
endpoint_mac_address = module.params.get("endpoint_mac_address")
285268
bd = module.params.get("bd")
286-
name = module.params.get("name")
287269
name_alias = module.params.get("name_alias")
288270
annotation = module.params.get("annotation")
289271
state = module.params.get("state")
290272

291273
aci = ACIModule(module)
292274

293-
endpoint_mac_tag_rn = None
294-
endpoint_mac_tag_module_object = None
295275
if endpoint_mac_address and bd:
296-
endpoint_mac_tag_rn = "eptags/epmactag-{0}-[{1}]".format(endpoint_mac_address, bd)
297276
endpoint_mac_tag_module_object = "{0}-[{1}]".format(endpoint_mac_address, bd)
277+
endpoint_mac_tag_rn = "eptags/epmactag-{0}".format(endpoint_mac_tag_module_object)
278+
else:
279+
endpoint_mac_tag_rn = None
280+
endpoint_mac_tag_module_object = None
298281

299282
aci.construct_url(
300283
root_class=dict(
@@ -320,7 +303,6 @@ def main():
320303
annotation=annotation,
321304
bdName=bd,
322305
mac=endpoint_mac_address,
323-
name=name,
324306
nameAlias=name_alias,
325307
),
326308
)

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
tenant: ansible_test
6363
endpoint_ip_address: "1.1.1.1"
6464
vrf: ansible_test_vrf
65-
name: TestObject_1
6665
name_alias: TestIPTag
6766
state: present
6867
output_level: debug
@@ -75,7 +74,6 @@
7574
tenant: ansible_test
7675
endpoint_ip_address: "1.1.1.1"
7776
vrf: ansible_test_vrf
78-
name: TestObject_1
7977
name_alias: TestIPTag
8078
state: present
8179
register: nm_add_ip_tag_1
@@ -86,7 +84,6 @@
8684
tenant: ansible_test
8785
endpoint_ip_address: "1.1.1.1"
8886
vrf: ansible_test_vrf
89-
name: TestObject_1
9087
name_alias: TestIPTag
9188
state: present
9289
register: nm_add_ip_tag_1_again
@@ -101,28 +98,27 @@
10198
- cm_add_ip_tag_1.proposed.fvEpIpTag.attributes.ctxName == "ansible_test_vrf"
10299
- cm_add_ip_tag_1.proposed.fvEpIpTag.attributes.dn == "uni/tn-ansible_test/eptags/epiptag-[1.1.1.1]-ansible_test_vrf"
103100
- cm_add_ip_tag_1.proposed.fvEpIpTag.attributes.ip == "1.1.1.1"
104-
- cm_add_ip_tag_1.proposed.fvEpIpTag.attributes.name == "TestObject_1"
105101
- cm_add_ip_tag_1.proposed.fvEpIpTag.attributes.nameAlias == "TestIPTag"
106102
- nm_add_ip_tag_1 is changed
107103
- nm_add_ip_tag_1.current.0.fvEpIpTag.attributes.annotation == "orchestrator:ansible"
108104
- nm_add_ip_tag_1.current.0.fvEpIpTag.attributes.ctxName == "ansible_test_vrf"
109105
- nm_add_ip_tag_1.current.0.fvEpIpTag.attributes.dn == "uni/tn-ansible_test/eptags/epiptag-[1.1.1.1]-ansible_test_vrf"
110106
- nm_add_ip_tag_1.current.0.fvEpIpTag.attributes.ip == "1.1.1.1"
111-
- nm_add_ip_tag_1.current.0.fvEpIpTag.attributes.name == "TestObject_1"
107+
- nm_add_ip_tag_1.current.0.fvEpIpTag.attributes.name == ""
112108
- nm_add_ip_tag_1.current.0.fvEpIpTag.attributes.nameAlias == "TestIPTag"
113109
- nm_add_ip_tag_1.previous == []
114110
- nm_add_ip_tag_1_again is not changed
115111
- nm_add_ip_tag_1_again.current.0.fvEpIpTag.attributes.annotation == "orchestrator:ansible"
116112
- nm_add_ip_tag_1_again.current.0.fvEpIpTag.attributes.ctxName == "ansible_test_vrf"
117113
- nm_add_ip_tag_1_again.current.0.fvEpIpTag.attributes.dn == "uni/tn-ansible_test/eptags/epiptag-[1.1.1.1]-ansible_test_vrf"
118114
- nm_add_ip_tag_1_again.current.0.fvEpIpTag.attributes.ip == "1.1.1.1"
119-
- nm_add_ip_tag_1_again.current.0.fvEpIpTag.attributes.name == "TestObject_1"
115+
- nm_add_ip_tag_1_again.current.0.fvEpIpTag.attributes.name == ""
120116
- nm_add_ip_tag_1_again.current.0.fvEpIpTag.attributes.nameAlias == "TestIPTag"
121117
- nm_add_ip_tag_1_again.previous.0.fvEpIpTag.attributes.annotation == "orchestrator:ansible"
122118
- nm_add_ip_tag_1_again.previous.0.fvEpIpTag.attributes.ctxName == "ansible_test_vrf"
123119
- nm_add_ip_tag_1_again.previous.0.fvEpIpTag.attributes.dn == "uni/tn-ansible_test/eptags/epiptag-[1.1.1.1]-ansible_test_vrf"
124120
- nm_add_ip_tag_1_again.previous.0.fvEpIpTag.attributes.ip == "1.1.1.1"
125-
- nm_add_ip_tag_1_again.previous.0.fvEpIpTag.attributes.name == "TestObject_1"
121+
- nm_add_ip_tag_1_again.previous.0.fvEpIpTag.attributes.name == ""
126122
- nm_add_ip_tag_1_again.previous.0.fvEpIpTag.attributes.nameAlias == "TestIPTag"
127123

128124
- name: Add IP Tag Object - 2 with same vrf and different ip address

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
tenant: ansible_test
6363
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
6464
bd: ansible_test_bd
65-
name: TestObject_1
6665
name_alias: TestMacTag
6766
state: present
6867
check_mode: true
@@ -74,7 +73,6 @@
7473
tenant: ansible_test
7574
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
7675
bd: ansible_test_bd
77-
name: TestObject_1
7876
name_alias: TestMacTag
7977
state: present
8078
register: nm_add_mac_tag_1
@@ -85,7 +83,6 @@
8583
tenant: ansible_test
8684
endpoint_mac_address: "AE:ED:EE:EE:AA:AA"
8785
bd: ansible_test_bd
88-
name: TestObject_1
8986
name_alias: TestMacTag
9087
state: present
9188
register: nm_add_mac_tag_1_again
@@ -100,28 +97,27 @@
10097
- cm_add_mac_tag_1.proposed.fvEpMacTag.attributes.bdName == "ansible_test_bd"
10198
- cm_add_mac_tag_1.proposed.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
10299
- cm_add_mac_tag_1.proposed.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
103-
- cm_add_mac_tag_1.proposed.fvEpMacTag.attributes.name == "TestObject_1"
104100
- cm_add_mac_tag_1.proposed.fvEpMacTag.attributes.nameAlias == "TestMacTag"
105101
- nm_add_mac_tag_1 is changed
106102
- nm_add_mac_tag_1.current.0.fvEpMacTag.attributes.annotation == "orchestrator:ansible"
107103
- nm_add_mac_tag_1.current.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
108104
- nm_add_mac_tag_1.current.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
109105
- nm_add_mac_tag_1.current.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
110-
- nm_add_mac_tag_1.current.0.fvEpMacTag.attributes.name == "TestObject_1"
106+
- nm_add_mac_tag_1.current.0.fvEpMacTag.attributes.name == ""
111107
- nm_add_mac_tag_1.current.0.fvEpMacTag.attributes.nameAlias == "TestMacTag"
112108
- nm_add_mac_tag_1.previous == []
113109
- nm_add_mac_tag_1_again is not changed
114110
- nm_add_mac_tag_1_again.current.0.fvEpMacTag.attributes.annotation == "orchestrator:ansible"
115111
- nm_add_mac_tag_1_again.current.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
116112
- nm_add_mac_tag_1_again.current.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
117113
- nm_add_mac_tag_1_again.current.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
118-
- nm_add_mac_tag_1_again.current.0.fvEpMacTag.attributes.name == "TestObject_1"
114+
- nm_add_mac_tag_1_again.current.0.fvEpMacTag.attributes.name == ""
119115
- nm_add_mac_tag_1_again.current.0.fvEpMacTag.attributes.nameAlias == "TestMacTag"
120116
- nm_add_mac_tag_1_again.previous.0.fvEpMacTag.attributes.annotation == "orchestrator:ansible"
121117
- nm_add_mac_tag_1_again.previous.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
122118
- nm_add_mac_tag_1_again.previous.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
123119
- nm_add_mac_tag_1_again.previous.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
124-
- nm_add_mac_tag_1_again.previous.0.fvEpMacTag.attributes.name == "TestObject_1"
120+
- nm_add_mac_tag_1_again.previous.0.fvEpMacTag.attributes.name == ""
125121
- nm_add_mac_tag_1_again.previous.0.fvEpMacTag.attributes.nameAlias == "TestMacTag"
126122

127123
- name: Add MAC Tag Object - 2 with same bd and different mac address
@@ -199,13 +195,13 @@
199195
- cm_update_mac_tag_1.current.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
200196
- cm_update_mac_tag_1.current.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
201197
- cm_update_mac_tag_1.current.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
202-
- cm_update_mac_tag_1.current.0.fvEpMacTag.attributes.name == "TestObject_1"
198+
- cm_update_mac_tag_1.current.0.fvEpMacTag.attributes.name == ""
203199
- cm_update_mac_tag_1.current.0.fvEpMacTag.attributes.nameAlias == "TestMacTag"
204200
- cm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.annotation == "orchestrator:ansible"
205201
- cm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
206202
- cm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
207203
- cm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
208-
- cm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.name == "TestObject_1"
204+
- cm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.name == ""
209205
- cm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.nameAlias == "TestMacTag"
210206
- cm_update_mac_tag_1.proposed.fvEpMacTag.attributes.annotation == "annotation"
211207
- cm_update_mac_tag_1.proposed.fvEpMacTag.attributes.bdName == "ansible_test_bd"
@@ -217,26 +213,26 @@
217213
- nm_update_mac_tag_1.current.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
218214
- nm_update_mac_tag_1.current.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
219215
- nm_update_mac_tag_1.current.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
220-
- nm_update_mac_tag_1.current.0.fvEpMacTag.attributes.name == "TestObject_1"
216+
- nm_update_mac_tag_1.current.0.fvEpMacTag.attributes.name == ""
221217
- nm_update_mac_tag_1.current.0.fvEpMacTag.attributes.nameAlias == "Updated_TestMacTag"
222218
- nm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.annotation == "orchestrator:ansible"
223219
- nm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
224220
- nm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
225221
- nm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
226-
- nm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.name == "TestObject_1"
222+
- nm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.name == ""
227223
- nm_update_mac_tag_1.previous.0.fvEpMacTag.attributes.nameAlias == "TestMacTag"
228224
- nm_update_mac_tag_1_again is not changed
229225
- nm_update_mac_tag_1_again.current.0.fvEpMacTag.attributes.annotation == "annotation"
230226
- nm_update_mac_tag_1_again.current.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
231227
- nm_update_mac_tag_1_again.current.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
232228
- nm_update_mac_tag_1_again.current.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
233-
- nm_update_mac_tag_1_again.current.0.fvEpMacTag.attributes.name == "TestObject_1"
229+
- nm_update_mac_tag_1_again.current.0.fvEpMacTag.attributes.name == ""
234230
- nm_update_mac_tag_1_again.current.0.fvEpMacTag.attributes.nameAlias == "Updated_TestMacTag"
235231
- nm_update_mac_tag_1_again.previous.0.fvEpMacTag.attributes.annotation == "annotation"
236232
- nm_update_mac_tag_1_again.previous.0.fvEpMacTag.attributes.bdName == "ansible_test_bd"
237233
- nm_update_mac_tag_1_again.previous.0.fvEpMacTag.attributes.dn == "uni/tn-ansible_test/eptags/epmactag-AE:ED:EE:EE:AA:AA-[ansible_test_bd]"
238234
- nm_update_mac_tag_1_again.previous.0.fvEpMacTag.attributes.mac == "AE:ED:EE:EE:AA:AA"
239-
- nm_update_mac_tag_1_again.previous.0.fvEpMacTag.attributes.name == "TestObject_1"
235+
- nm_update_mac_tag_1_again.previous.0.fvEpMacTag.attributes.name == ""
240236
- nm_update_mac_tag_1_again.previous.0.fvEpMacTag.attributes.nameAlias == "Updated_TestMacTag"
241237

242238
# QUERY

0 commit comments

Comments
 (0)