| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
- name: Test that we have an ACI APIC host, ACI username and ACI password |
| 6 |
ansible.builtin.fail: |
| 7 |
msg: "Please define the following variables: aci_hostname, aci_username and aci_password." |
| 8 |
when: aci_hostname is not defined or aci_username is not defined or aci_password is not defined |
| 9 |
|
| 10 |
- name: Set vars |
| 11 |
ansible.builtin.set_fact: |
| 12 |
aci_info: &aci_info |
| 13 |
host: "{{ aci_hostname }}" |
| 14 |
username: "{{ aci_username }}" |
| 15 |
password: "{{ aci_password }}" |
| 16 |
validate_certs: "{{ aci_validate_certs | default(false) }}" |
| 17 |
use_ssl: "{{ aci_use_ssl | default(true) }}" |
| 18 |
use_proxy: "{{ aci_use_proxy | default(true) }}" |
| 19 |
output_level: "{{ aci_output_level | default('info') }}" |
| 20 |
|
| 21 |
|
| 22 |
- name: Remove tenant |
| 23 |
cisco.aci.aci_rest: &tenant_absent |
| 24 |
<<: *aci_info |
| 25 |
path: /api/mo/uni/tn-[ansible_test].json |
| 26 |
method: delete |
| 27 |
|
| 28 |
- name: Remove tenant 2 |
| 29 |
cisco.aci.aci_rest: |
| 30 |
<<: *tenant_absent |
| 31 |
path: /api/mo/uni/tn-[ansible_test_2].json |
| 32 |
|
| 33 |
|
| 34 |
- name: Add tenant (check mode) |
| 35 |
cisco.aci.aci_rest: &tenant_present |
| 36 |
<<: *aci_info |
| 37 |
path: /api/mo/uni.json |
| 38 |
method: post |
| 39 |
content: |
| 40 |
{ |
| 41 |
"fvTenant": { |
| 42 |
"attributes": { |
| 43 |
"name": "ansible_test" |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
register: cm_add_tenant |
| 48 |
check_mode: true |
| 49 |
|
| 50 |
- name: Verify checkmode did not create tenant |
| 51 |
cisco.aci.aci_tenant: |
| 52 |
<<: *aci_info |
| 53 |
name: ansible_test |
| 54 |
state: query |
| 55 |
register: cm_verify_checkmode_tenant |
| 56 |
|
| 57 |
- name: Verify checkmode POST operation |
| 58 |
ansible.builtin.assert: |
| 59 |
that: |
| 60 |
- cm_add_tenant is changed |
| 61 |
- cm_add_tenant.proposed.fvTenant.attributes.name == "ansible_test" |
| 62 |
- cm_add_tenant.proposed.fvTenant.attributes.annotation == "orchestrator:ansible" |
| 63 |
- cm_verify_checkmode_tenant.current == [] |
| 64 |
|
| 65 |
- name: Add tenant (normal mode) |
| 66 |
cisco.aci.aci_rest: *tenant_present |
| 67 |
register: nm_add_tenant |
| 68 |
|
| 69 |
- name: Add tenant again (normal mode) |
| 70 |
cisco.aci.aci_rest: *tenant_present |
| 71 |
register: nm_add_tenant_again |
| 72 |
|
| 73 |
- name: Verify add_tenant |
| 74 |
ansible.builtin.assert: |
| 75 |
that: |
| 76 |
- nm_add_tenant is changed |
| 77 |
- nm_add_tenant.imdata.0.fvTenant.attributes.annotation == "orchestrator:ansible" |
| 78 |
- nm_add_tenant_again is not changed |
| 79 |
|
| 80 |
|
| 81 |
- name: Change description of tenant (normal mode) |
| 82 |
cisco.aci.aci_rest: &tenant_changed |
| 83 |
<<: *aci_info |
| 84 |
path: /api/mo/uni.json |
| 85 |
method: post |
| 86 |
content: |
| 87 |
{ |
| 88 |
"fvTenant": { |
| 89 |
"attributes": { |
| 90 |
"descr": "Ansible test tenant", |
| 91 |
"name": "ansible_test" |
| 92 |
} |
| 93 |
} |
| 94 |
} |
| 95 |
register: nm_add_tenant_descr |
| 96 |
|
| 97 |
- name: Change description of tenant again (normal mode) |
| 98 |
cisco.aci.aci_rest: *tenant_changed |
| 99 |
register: nm_add_tenant_descr_again |
| 100 |
|
| 101 |
- name: Verify add_tenant_descr |
| 102 |
ansible.builtin.assert: |
| 103 |
that: |
| 104 |
- nm_add_tenant_descr is changed |
| 105 |
- nm_add_tenant_descr_again is not changed |
| 106 |
|
| 107 |
|
| 108 |
- name: Add tenant again with no description (normal mode) |
| 109 |
cisco.aci.aci_rest: *tenant_present |
| 110 |
register: nm_add_tenant_again_no_descr |
| 111 |
|
| 112 |
- name: Verify add_tenant_again_no_descr |
| 113 |
ansible.builtin.assert: |
| 114 |
that: |
| 115 |
- nm_add_tenant_again_no_descr is not changed |
| 116 |
|
| 117 |
|
| 118 |
- name: Query all tenants (normal mode) |
| 119 |
cisco.aci.aci_rest: &tenant_query_all |
| 120 |
<<: *aci_info |
| 121 |
path: /api/mo/uni/tn-[ansible_test].json |
| 122 |
method: get |
| 123 |
register: nm_query_all_tenants |
| 124 |
|
| 125 |
- name: Verify query_all_tenants |
| 126 |
ansible.builtin.assert: |
| 127 |
that: |
| 128 |
- nm_query_all_tenants is not changed |
| 129 |
|
| 130 |
|
| 131 |
- name: Add tenant 2 (normal mode) |
| 132 |
cisco.aci.aci_rest: |
| 133 |
<<: *tenant_present |
| 134 |
content: |
| 135 |
{ |
| 136 |
"fvTenant": { |
| 137 |
"attributes": { |
| 138 |
"descr": "Ansible test tenant", |
| 139 |
"name": "ansible_test_2" |
| 140 |
} |
| 141 |
} |
| 142 |
} |
| 143 |
|
| 144 |
|
| 145 |
- name: Query all tenants with pagination (normal mode) |
| 146 |
cisco.aci.aci_rest: &tenant_query_all_paginated |
| 147 |
<<: *aci_info |
| 148 |
path: /api/class/uni/fvTenant.json |
| 149 |
page_size: 10 |
| 150 |
method: get |
| 151 |
register: nm_query_all_tenants_paginated |
| 152 |
|
| 153 |
- name: Query all tenant with pagination - Size 1 / Page 0 (normal mode) |
| 154 |
cisco.aci.aci_rest: |
| 155 |
<<: *tenant_query_all_paginated |
| 156 |
page_size: 1 |
| 157 |
register: nm_query_all_tenants_paginated_1_0 |
| 158 |
|
| 159 |
- name: Query all tenant with pagination - Size 1 / Page 1 (normal mode) |
| 160 |
cisco.aci.aci_rest: |
| 161 |
<<: *tenant_query_all_paginated |
| 162 |
page_size: 1 |
| 163 |
page: 1 |
| 164 |
register: nm_query_all_tenants_paginated_1_1 |
| 165 |
|
| 166 |
- name: Query all tenant with pagination - Size 2 / Page 0 (normal mode) |
| 167 |
cisco.aci.aci_rest: |
| 168 |
<<: *tenant_query_all_paginated |
| 169 |
page_size: 2 |
| 170 |
register: nm_query_all_tenants_paginated_2_0 |
| 171 |
|
| 172 |
- name: Verify query_all_tenants_paginated |
| 173 |
ansible.builtin.assert: |
| 174 |
that: |
| 175 |
- nm_query_all_tenants_paginated is not changed |
| 176 |
- nm_query_all_tenants_paginated_1_0 is not changed |
| 177 |
- nm_query_all_tenants_paginated_1_1 is not changed |
| 178 |
- nm_query_all_tenants_paginated_2_0 is not changed |
| 179 |
|
| 180 |
- name: Verify pagination works as expected |
| 181 |
ansible.builtin.assert: |
| 182 |
that: |
| 183 |
- nm_query_all_tenants_paginated is not changed |
| 184 |
- nm_query_all_tenants_paginated_1_0.imdata | length == 1 |
| 185 |
- nm_query_all_tenants_paginated_1_1.imdata | length == 1 |
| 186 |
- nm_query_all_tenants_paginated_2_0.imdata | length == 2 |
| 187 |
- nm_query_all_tenants_paginated_1_0.imdata.0.fvTenant.attributes.name == nm_query_all_tenants_paginated_2_0.imdata.0.fvTenant.attributes.name |
| 188 |
- nm_query_all_tenants_paginated_1_1.imdata.0.fvTenant.attributes.name == nm_query_all_tenants_paginated_2_0.imdata.1.fvTenant.attributes.name |
| 189 |
|
| 190 |
|
| 191 |
- name: Query our tenant |
| 192 |
cisco.aci.aci_rest: &tenant_query |
| 193 |
<<: *aci_info |
| 194 |
path: /api/mo/uni/tn-[ansible_test].json |
| 195 |
method: get |
| 196 |
register: nm_query_tenant |
| 197 |
|
| 198 |
- name: Verify query_tenant |
| 199 |
ansible.builtin.assert: |
| 200 |
that: |
| 201 |
- nm_query_tenant is not changed |
| 202 |
|
| 203 |
|
| 204 |
- name: Remove tenant (normal mode) |
| 205 |
cisco.aci.aci_rest: *tenant_absent |
| 206 |
register: nm_remove_tenant |
| 207 |
|
| 208 |
- name: Remove tenant_2 (normal mode) |
| 209 |
cisco.aci.aci_rest: |
| 210 |
<<: *tenant_absent |
| 211 |
path: /api/mo/uni/tn-[ansible_test_2].json |
| 212 |
register: nm_remove_tenant_2 |
| 213 |
|
| 214 |
- name: Remove tenant again (normal mode) |
| 215 |
cisco.aci.aci_rest: *tenant_absent |
| 216 |
register: nm_remove_tenant_again |
| 217 |
|
| 218 |
- name: Verify remove_tenant |
| 219 |
ansible.builtin.assert: |
| 220 |
that: |
| 221 |
- nm_remove_tenant is changed |
| 222 |
- nm_remove_tenant_again is not changed |
| 223 |
|
| 224 |
|
| 225 |
- name: Query non-existing tenant (normal mode) |
| 226 |
cisco.aci.aci_rest: *tenant_query |
| 227 |
register: nm_query_non_tenant |
| 228 |
|
| 229 |
- name: Verify query_non_tenant |
| 230 |
ansible.builtin.assert: |
| 231 |
that: |
| 232 |
- nm_query_non_tenant is not changed |
| 233 |
|
| 234 |
|
| 235 |
- name: Add tenant with annotation option |
| 236 |
cisco.aci.aci_rest: |
| 237 |
<<: *aci_info |
| 238 |
path: /api/mo/uni.json |
| 239 |
method: post |
| 240 |
annotation: test:inoption |
| 241 |
content: |
| 242 |
{ |
| 243 |
"fvTenant": { |
| 244 |
"attributes": { |
| 245 |
"descr": "Ansible test tenant", |
| 246 |
"name": "ansible_test" |
| 247 |
} |
| 248 |
} |
| 249 |
} |
| 250 |
register: nm_add_tenant_annotation_option |
| 251 |
|
| 252 |
- name: Add tenant with annotation in content |
| 253 |
cisco.aci.aci_rest: |
| 254 |
<<: *aci_info |
| 255 |
path: /api/mo/uni.json |
| 256 |
method: post |
| 257 |
content: |
| 258 |
{ |
| 259 |
"fvTenant": { |
| 260 |
"attributes": { |
| 261 |
"descr": "Ansible test tenant", |
| 262 |
"name": "ansible_test", |
| 263 |
"annotation": "test:incontent" |
| 264 |
} |
| 265 |
} |
| 266 |
} |
| 267 |
register: nm_add_tenant_annotation_content |
| 268 |
|
| 269 |
- name: Add tenant with annotation in content and option |
| 270 |
cisco.aci.aci_rest: |
| 271 |
<<: *aci_info |
| 272 |
path: /api/mo/uni.json |
| 273 |
method: post |
| 274 |
annotation: test:inoption |
| 275 |
content: |
| 276 |
{ |
| 277 |
"fvTenant": { |
| 278 |
"attributes": { |
| 279 |
"descr": "Ansible test tenant", |
| 280 |
"name": "ansible_test", |
| 281 |
"annotation": "test:optionincontent" |
| 282 |
} |
| 283 |
} |
| 284 |
} |
| 285 |
register: nm_add_tenant_annotation_option_content |
| 286 |
|
| 287 |
- name: Add tag to tenant with annotation unsupported |
| 288 |
cisco.aci.aci_rest: |
| 289 |
<<: *aci_info |
| 290 |
path: /api/mo/uni/tn-ansible_test/tagKey-foo.json |
| 291 |
method: post |
| 292 |
annotation: test:inoption |
| 293 |
content: |
| 294 |
{ |
| 295 |
"tagTag": { |
| 296 |
"attributes": { |
| 297 |
"value": "bar" |
| 298 |
} |
| 299 |
} |
| 300 |
} |
| 301 |
register: nm_add_tag_no_annotation |
| 302 |
|
| 303 |
- name: Remove tenant |
| 304 |
cisco.aci.aci_rest: *tenant_absent |
| 305 |
|
| 306 |
- name: Add tenant with children objects including annotation |
| 307 |
cisco.aci.aci_rest: |
| 308 |
<<: *aci_info |
| 309 |
path: /api/mo/uni.json |
| 310 |
method: post |
| 311 |
annotation: test:inoption |
| 312 |
content: |
| 313 |
{ |
| 314 |
"fvTenant": { |
| 315 |
"attributes": { |
| 316 |
"descr": "Ansible test tenant", |
| 317 |
"name": "ansible_test" |
| 318 |
}, |
| 319 |
"children": [ |
| 320 |
{ |
| 321 |
"fvCtx": { |
| 322 |
"attributes": { |
| 323 |
"name": "VRF1" |
| 324 |
} |
| 325 |
} |
| 326 |
}, |
| 327 |
{ |
| 328 |
"fvAp": { |
| 329 |
"attributes": { |
| 330 |
"name": "Application1" |
| 331 |
}, |
| 332 |
"children": [ |
| 333 |
{ |
| 334 |
"fvAEPg": { |
| 335 |
"attributes": { |
| 336 |
"name": "WebTier", |
| 337 |
"annotation": "test:inchild" |
| 338 |
} |
| 339 |
} |
| 340 |
} |
| 341 |
] |
| 342 |
} |
| 343 |
} |
| 344 |
] |
| 345 |
} |
| 346 |
} |
| 347 |
register: nm_add_tenant_annotation_children |
| 348 |
|
| 349 |
- name: Verify annotation support |
| 350 |
assert: |
| 351 |
that: |
| 352 |
- nm_add_tenant_annotation_option.imdata.0.fvTenant.attributes.annotation == "test:inoption" |
| 353 |
- nm_add_tenant_annotation_content.imdata.0.fvTenant.attributes.annotation == "test:incontent" |
| 354 |
- nm_add_tenant_annotation_option_content.imdata.0.fvTenant.attributes.annotation == "test:optionincontent" |
| 355 |
- nm_add_tag_no_annotation.imdata.0.tagTag.attributes.annotation is undefined |
| 356 |
- nm_add_tenant_annotation_children.imdata.0.fvTenant.attributes.annotation == "test:inoption" |
| 357 |
- nm_add_tenant_annotation_children.imdata.0.fvTenant.children.0.fvAp.attributes.annotation == "test:inoption" |
| 358 |
- nm_add_tenant_annotation_children.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.annotation == "test:inchild" |
| 359 |
- nm_add_tenant_annotation_children.imdata.0.fvTenant.children.2.fvCtx.attributes.annotation == "test:inoption" |
| 360 |
|
| 361 |
|
| 362 |
- name: Disable Intersight Connectivity |
| 363 |
cisco.aci.aci_rest: |
| 364 |
<<: *aci_info |
| 365 |
path: /connector/Systems.json |
| 366 |
method: post |
| 367 |
rsp_subtree_preserve: true |
| 368 |
content: |
| 369 |
{ |
| 370 |
"AdminState": false |
| 371 |
} |
| 372 |
register: disable_intersight_connectivity |
| 373 |
|
| 374 |
- name: Verify Intersight Connectivity is disabled |
| 375 |
assert: |
| 376 |
that: |
| 377 |
- disable_intersight_connectivity.imdata.0.AdminState == false |
| 378 |
|
| 379 |
|
| 380 |
- name: Ensure Port Channel interface policy does not exists |
| 381 |
cisco.aci.aci_rest: |
| 382 |
<<: *aci_info |
| 383 |
path: api/mo/uni/infra/lacpifp-link_aggregation_control_protocol.json |
| 384 |
method: delete |
| 385 |
register: rm_link_aggregation_control_protocol |
| 386 |
|
| 387 |
- name: Add Port Channel interface policy JSON with prio attribute int value (check_mode) |
| 388 |
environment: |
| 389 |
ACI_NORMALIZE_PAYLOAD_VALUES: "true" |
| 390 |
cisco.aci.aci_rest: &cm_add_link_aggregation_control_protocol_json |
| 391 |
<<: *aci_info |
| 392 |
path: api/mo/uni/infra/lacpifp-link_aggregation_control_protocol.json |
| 393 |
method: post |
| 394 |
content: |
| 395 |
{ |
| 396 |
"lacpIfPol": { |
| 397 |
"attributes": { |
| 398 |
"annotation": "orchestrator:ansible", |
| 399 |
"descr": null, |
| 400 |
"name": "link_aggregation_control_protocol", |
| 401 |
"prio": 32768 |
| 402 |
} |
| 403 |
} |
| 404 |
} |
| 405 |
check_mode: true |
| 406 |
register: cm_add_link_aggregation_control_protocol |
| 407 |
|
| 408 |
- name: Add Port Channel interface policy JSON with prio attribute int value |
| 409 |
environment: |
| 410 |
ACI_NORMALIZE_PAYLOAD_VALUES: "true" |
| 411 |
cisco.aci.aci_rest: |
| 412 |
<<: *cm_add_link_aggregation_control_protocol_json |
| 413 |
register: nm_add_link_aggregation_control_protocol |
| 414 |
|
| 415 |
- name: Add Port Channel interface policy JSON with prio attribute int value again |
| 416 |
environment: |
| 417 |
ACI_NORMALIZE_PAYLOAD_VALUES: "true" |
| 418 |
cisco.aci.aci_rest: |
| 419 |
<<: *cm_add_link_aggregation_control_protocol_json |
| 420 |
register: nm_add_link_aggregation_control_protocol_again |
| 421 |
|
| 422 |
- name: Delete Port Channel interface policy |
| 423 |
cisco.aci.aci_rest: |
| 424 |
<<: *aci_info |
| 425 |
path: api/mo/uni/infra/lacpifp-link_aggregation_control_protocol.json |
| 426 |
method: delete |
| 427 |
register: rm_link_aggregation_control_protocol |
| 428 |
|
| 429 |
- name: Assertion check for add Port Channel interface policy JSON with prio attribute int value |
| 430 |
ansible.builtin.assert: |
| 431 |
that: |
| 432 |
- cm_add_link_aggregation_control_protocol is changed |
| 433 |
- cm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.annotation == "orchestrator:ansible" |
| 434 |
- cm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.descr == "" |
| 435 |
- cm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.name == "link_aggregation_control_protocol" |
| 436 |
- cm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.prio == "32768" |
| 437 |
- nm_add_link_aggregation_control_protocol is changed |
| 438 |
- nm_add_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.annotation == "orchestrator:ansible" |
| 439 |
- nm_add_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.descr == "" |
| 440 |
- nm_add_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.dn == "uni/infra/lacpifp-link_aggregation_control_protocol" |
| 441 |
- nm_add_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.name == "link_aggregation_control_protocol" |
| 442 |
- nm_add_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.prio == "32768" |
| 443 |
- nm_add_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.rn == "" |
| 444 |
- nm_add_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.status == "created" |
| 445 |
- nm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.annotation == "orchestrator:ansible" |
| 446 |
- nm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.descr == "" |
| 447 |
- nm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.name == "link_aggregation_control_protocol" |
| 448 |
- nm_add_link_aggregation_control_protocol.proposed.lacpIfPol.attributes.prio == "32768" |
| 449 |
- nm_add_link_aggregation_control_protocol_again is not changed |
| 450 |
- nm_add_link_aggregation_control_protocol_again.imdata == [] |
| 451 |
- nm_add_link_aggregation_control_protocol_again.proposed == nm_add_link_aggregation_control_protocol.proposed |
| 452 |
- rm_link_aggregation_control_protocol is changed |
| 453 |
- rm_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.annotation == "orchestrator:ansible" |
| 454 |
- rm_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.descr == "" |
| 455 |
- rm_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.dn == "uni/infra/lacpifp-link_aggregation_control_protocol" |
| 456 |
- rm_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.name == "link_aggregation_control_protocol" |
| 457 |
- rm_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.prio == "32768" |
| 458 |
- rm_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.rn == "" |
| 459 |
- rm_link_aggregation_control_protocol.imdata.0.lacpIfPol.attributes.status == "deleted" |
| 460 |
|
| 461 |
- name: Ensure ansible_test_json tenant does not exists |
| 462 |
cisco.aci.aci_rest: |
| 463 |
<<: *aci_info |
| 464 |
path: api/mo/uni/tn-ansible_test_json.json |
| 465 |
method: delete |
| 466 |
|
| 467 |
- name: Add tenant with nested child objects (check_mode) |
| 468 |
environment: |
| 469 |
ACI_NORMALIZE_PAYLOAD_VALUES: "true" |
| 470 |
cisco.aci.aci_rest: &cm_add_tenant_json |
| 471 |
<<: *aci_info |
| 472 |
path: api/mo/uni/tn-ansible_test_json.json |
| 473 |
method: post |
| 474 |
content: |
| 475 |
fvTenant: |
| 476 |
attributes: |
| 477 |
annotation: "test:inoption" |
| 478 |
descr: "Ansible test tenant" |
| 479 |
dn: "uni/tn-ansible_test_json" |
| 480 |
name: "ansible_test_json" |
| 481 |
children: |
| 482 |
- fvAp: |
| 483 |
attributes: |
| 484 |
name: "ap1" |
| 485 |
descr: "" |
| 486 |
children: |
| 487 |
- fvAEPg: |
| 488 |
attributes: |
| 489 |
floodOnEncap: "disabled" |
| 490 |
hasMcastSource: "no" |
| 491 |
isAttrBasedEPg: "yes" |
| 492 |
matchT: "AtleastOne" |
| 493 |
name: "usge_epg" |
| 494 |
pcEnfPref: "unenforced" |
| 495 |
prefGrMemb: "exclude" |
| 496 |
prio: "level3" |
| 497 |
shutdown: "no" |
| 498 |
children: |
| 499 |
- fvCrtrn: |
| 500 |
attributes: |
| 501 |
match: "any" |
| 502 |
name: "default" |
| 503 |
prec: 100 |
| 504 |
scope: "scope-bd" |
| 505 |
- fvRsBd: |
| 506 |
attributes: |
| 507 |
tnFvBDName: "default" |
| 508 |
- ospfIfPol: |
| 509 |
attributes: |
| 510 |
cost: 11 |
| 511 |
ctrl: "mtu-ignore" |
| 512 |
deadIntvl: 12 |
| 513 |
helloIntvl: 13 |
| 514 |
name: "ansible_ospf" |
| 515 |
nwT: "bcast" |
| 516 |
pfxSuppress: "disable" |
| 517 |
prio: 220 |
| 518 |
rexmitIntvl: 15 |
| 519 |
xmitDelay: 16 |
| 520 |
check_mode: true |
| 521 |
register: cm_add_tenant_json |
| 522 |
|
| 523 |
- name: Add tenant with nested child objects |
| 524 |
environment: |
| 525 |
ACI_NORMALIZE_PAYLOAD_VALUES: "true" |
| 526 |
cisco.aci.aci_rest: |
| 527 |
<<: *cm_add_tenant_json |
| 528 |
register: nm_add_tenant_json |
| 529 |
|
| 530 |
- name: Add tenant with nested child objects again |
| 531 |
environment: |
| 532 |
ACI_NORMALIZE_PAYLOAD_VALUES: "true" |
| 533 |
cisco.aci.aci_rest: |
| 534 |
<<: *cm_add_tenant_json |
| 535 |
register: nm_add_tenant_json_again |
| 536 |
|
| 537 |
- name: Remove tenant with nested child objects |
| 538 |
cisco.aci.aci_rest: |
| 539 |
<<: *aci_info |
| 540 |
path: api/mo/uni/tn-ansible_test_json.json |
| 541 |
method: delete |
| 542 |
register: rm_tenant_json |
| 543 |
|
| 544 |
- name: Assertion check for add tenant with nested child objects |
| 545 |
ansible.builtin.assert: |
| 546 |
that: |
| 547 |
- cm_add_tenant_json is changed |
| 548 |
- cm_add_tenant_json.proposed.fvTenant.attributes.annotation == "test:inoption" |
| 549 |
- cm_add_tenant_json.proposed.fvTenant.attributes.descr == "Ansible test tenant" |
| 550 |
- cm_add_tenant_json.proposed.fvTenant.attributes.dn == "uni/tn-ansible_test_json" |
| 551 |
- cm_add_tenant_json.proposed.fvTenant.attributes.name == "ansible_test_json" |
| 552 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.attributes.annotation == "orchestrator:ansible" |
| 553 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.attributes.name == "ap1" |
| 554 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.attributes.descr == "" |
| 555 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.annotation == "orchestrator:ansible" |
| 556 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.floodOnEncap == "disabled" |
| 557 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.hasMcastSource == "no" |
| 558 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.isAttrBasedEPg == "yes" |
| 559 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.matchT == "AtleastOne" |
| 560 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.name == "usge_epg" |
| 561 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.pcEnfPref == "unenforced" |
| 562 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.prefGrMemb == "exclude" |
| 563 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.prio == "level3" |
| 564 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.shutdown == "no" |
| 565 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.annotation == "orchestrator:ansible" |
| 566 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.match == "any" |
| 567 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.name == "default" |
| 568 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.prec == "100" |
| 569 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.scope == "scope-bd" |
| 570 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.children.1.fvRsBd.attributes.annotation == "orchestrator:ansible" |
| 571 |
- cm_add_tenant_json.proposed.fvTenant.children.0.fvAp.children.0.fvAEPg.children.1.fvRsBd.attributes.tnFvBDName == "default" |
| 572 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.annotation == "orchestrator:ansible" |
| 573 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.cost == "11" |
| 574 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.ctrl == "mtu-ignore" |
| 575 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.deadIntvl == "12" |
| 576 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.helloIntvl == "13" |
| 577 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.name == "ansible_ospf" |
| 578 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.nwT == "bcast" |
| 579 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.pfxSuppress == "disable" |
| 580 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.prio == "220" |
| 581 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.rexmitIntvl == "15" |
| 582 |
- cm_add_tenant_json.proposed.fvTenant.children.1.ospfIfPol.attributes.xmitDelay == "16" |
| 583 |
- nm_add_tenant_json is changed |
| 584 |
- nm_add_tenant_json.imdata.0.fvTenant.attributes.annotation == "test:inoption" |
| 585 |
- nm_add_tenant_json.imdata.0.fvTenant.attributes.descr == "Ansible test tenant" |
| 586 |
- nm_add_tenant_json.imdata.0.fvTenant.attributes.dn == "uni/tn-ansible_test_json" |
| 587 |
- nm_add_tenant_json.imdata.0.fvTenant.attributes.name == "ansible_test_json" |
| 588 |
- nm_add_tenant_json.imdata.0.fvTenant.attributes.rn == "" |
| 589 |
- nm_add_tenant_json.imdata.0.fvTenant.attributes.status == "created" |
| 590 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.attributes.annotation == "orchestrator:ansible" |
| 591 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.attributes.descr == "" |
| 592 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.attributes.name == "ap1" |
| 593 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.attributes.prio == "unspecified" |
| 594 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.attributes.rn == "ap-ap1" |
| 595 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.attributes.status == "created" |
| 596 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.annotation == "orchestrator:ansible" |
| 597 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.configIssues == "" |
| 598 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.configSt == "not-applied" |
| 599 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.descr == "" |
| 600 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.exceptionTag == "" |
| 601 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.floodOnEncap == "disabled" |
| 602 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.fwdCtrl == "" |
| 603 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.hasMcastSource == "no" |
| 604 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.isAttrBasedEPg == "yes" |
| 605 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.isSharedSrvMsiteEPg == "no" |
| 606 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.matchT == "AtleastOne" |
| 607 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.name == "usge_epg" |
| 608 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.pcEnfPref == "unenforced" |
| 609 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.pcTag == "any" |
| 610 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.pcTagAllocSrc == "idmanager" |
| 611 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.prefGrMemb == "exclude" |
| 612 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.prio == "level3" |
| 613 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.rn == "epg-usge_epg" |
| 614 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.scope == "0" |
| 615 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.shutdown == "no" |
| 616 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.status == "created" |
| 617 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.triggerSt == "not_triggerable" |
| 618 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.attributes.txId == "0" |
| 619 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.annotation == "orchestrator:ansible" |
| 620 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.name == "default" |
| 621 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.prec == "100" |
| 622 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.children.0.fvCrtrn.attributes.rn == "crtrn" |
| 623 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.children.1.fvRsBd.attributes.annotation == "orchestrator:ansible" |
| 624 |
- nm_add_tenant_json.imdata.0.fvTenant.children.0.fvAp.children.0.fvAEPg.children.1.fvRsBd.attributes.tnFvBDName == "default" |
| 625 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.annotation == "orchestrator:ansible" |
| 626 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.cost == "11" |
| 627 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.ctrl == "mtu-ignore" |
| 628 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.deadIntvl == "12" |
| 629 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.descr == "" |
| 630 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.helloIntvl == "13" |
| 631 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.name == "ansible_ospf" |
| 632 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.nwT == "bcast" |
| 633 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.pfxSuppress == "disable" |
| 634 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.prio == "220" |
| 635 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.rexmitIntvl == "15" |
| 636 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.rn == "ospfIfPol-ansible_ospf" |
| 637 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.status == "created" |
| 638 |
- nm_add_tenant_json.imdata.0.fvTenant.children.2.ospfIfPol.attributes.xmitDelay == "16" |
| 639 |
- cm_add_tenant_json.proposed == nm_add_tenant_json.proposed == nm_add_tenant_json_again.proposed |
| 640 |
- nm_add_tenant_json_again is not changed |
| 641 |
- nm_add_tenant_json_again.imdata == [] |
| 642 |
- nm_add_tenant_json.proposed == nm_add_tenant_json_again.proposed |
| 643 |
- rm_tenant_json is changed |
| 644 |
- rm_tenant_json.imdata.0.fvTenant.attributes.annotation == "test:inoption" |
| 645 |
- rm_tenant_json.imdata.0.fvTenant.attributes.descr == "Ansible test tenant" |
| 646 |
- rm_tenant_json.imdata.0.fvTenant.attributes.dn == "uni/tn-ansible_test_json" |
| 647 |
- rm_tenant_json.imdata.0.fvTenant.attributes.name == "ansible_test_json" |
| 648 |
- rm_tenant_json.imdata.0.fvTenant.attributes.rn == "" |
| 649 |
- rm_tenant_json.imdata.0.fvTenant.attributes.status == "deleted" |