| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
- name: Test that we have an ACI APIC host, ACI username and ACI password |
| 7 |
ansible.builtin.fail: |
| 8 |
msg: 'Please define the following variables: aci_hostname, aci_username and aci_password.' |
| 9 |
when: aci_hostname is not defined or aci_username is not defined or aci_password is not defined |
| 10 |
|
| 11 |
- name: Set vars |
| 12 |
ansible.builtin.set_fact: |
| 13 |
aci_info: &aci_info |
| 14 |
host: "{{ aci_hostname }}" |
| 15 |
username: "{{ aci_username }}" |
| 16 |
password: "{{ aci_password }}" |
| 17 |
validate_certs: '{{ aci_validate_certs | default(false) }}' |
| 18 |
use_ssl: '{{ aci_use_ssl | default(true) }}' |
| 19 |
use_proxy: '{{ aci_use_proxy | default(true) }}' |
| 20 |
output_level: debug |
| 21 |
|
| 22 |
- name: Assure tenant removal after tests |
| 23 |
block: |
| 24 |
- name: ensure tenant is deleted for clean state |
| 25 |
cisco.aci.aci_tenant: |
| 26 |
<<: *aci_info |
| 27 |
tenant: ansible_test |
| 28 |
state: absent |
| 29 |
|
| 30 |
- name: ensure OOB contract is deleted for clean state |
| 31 |
cisco.aci.aci_oob_contract: |
| 32 |
<<: *aci_info |
| 33 |
contract: ansible_test_oob_contract |
| 34 |
state: absent |
| 35 |
|
| 36 |
- name: ensure tenant exists for tests to kick off |
| 37 |
cisco.aci.aci_tenant: &aci_tenant_present |
| 38 |
<<: *aci_info |
| 39 |
tenant: ansible_test |
| 40 |
state: present |
| 41 |
register: tenant_present |
| 42 |
|
| 43 |
- name: ensure contract exists for tests to kick off |
| 44 |
cisco.aci.aci_contract: &aci_contract_present |
| 45 |
<<: *aci_tenant_present |
| 46 |
contract: anstest |
| 47 |
register: contract_present |
| 48 |
|
| 49 |
- name: ensure OOB contract exists for tests to kick off |
| 50 |
cisco.aci.aci_oob_contract: |
| 51 |
<<: *aci_info |
| 52 |
contract: ansible_test_oob_contract |
| 53 |
state: present |
| 54 |
|
| 55 |
- name: create subject - check mode works |
| 56 |
cisco.aci.aci_contract_subject: &aci_subject_present |
| 57 |
<<: *aci_contract_present |
| 58 |
subject: anstest |
| 59 |
description: Ansible Test |
| 60 |
check_mode: true |
| 61 |
register: subject_present_check_mode |
| 62 |
|
| 63 |
- name: create subject - creation works |
| 64 |
cisco.aci.aci_contract_subject: |
| 65 |
<<: *aci_subject_present |
| 66 |
register: subject_present |
| 67 |
|
| 68 |
- name: create subject - idempotency works |
| 69 |
cisco.aci.aci_contract_subject: |
| 70 |
<<: *aci_subject_present |
| 71 |
register: subject_present_idempotent |
| 72 |
|
| 73 |
- name: update subject - update works |
| 74 |
cisco.aci.aci_contract_subject: |
| 75 |
<<: *aci_subject_present |
| 76 |
description: Ansible Test |
| 77 |
reverse_filter: "yes" |
| 78 |
provider_match: at_most_one |
| 79 |
priority: level2 |
| 80 |
register: subject_update |
| 81 |
|
| 82 |
- name: create subject - try additional params |
| 83 |
cisco.aci.aci_contract_subject: &aci_subject_present_2 |
| 84 |
<<: *aci_contract_present |
| 85 |
subject: anstest2 |
| 86 |
reverse_filter: "no" |
| 87 |
consumer_match: all |
| 88 |
priority: level3 |
| 89 |
register: subject_present_2 |
| 90 |
|
| 91 |
- name: missing param - failure message works |
| 92 |
cisco.aci.aci_contract_subject: |
| 93 |
<<: *aci_tenant_present |
| 94 |
ignore_errors: true |
| 95 |
register: present_missing_param |
| 96 |
|
| 97 |
- name: present assertions |
| 98 |
ansible.builtin.assert: |
| 99 |
that: |
| 100 |
- subject_present_check_mode is changed |
| 101 |
- subject_present_check_mode.sent.vzSubj.attributes.descr == 'Ansible Test' |
| 102 |
- subject_present_check_mode.sent.vzSubj.attributes.name == 'anstest' |
| 103 |
- subject_present is changed |
| 104 |
- subject_present.previous == [] |
| 105 |
- subject_present.sent == subject_present_check_mode.sent |
| 106 |
- subject_present.current.0.vzSubj.attributes.annotation == 'orchestrator:ansible' |
| 107 |
- subject_present_idempotent is not changed |
| 108 |
- subject_present_idempotent.previous != [] |
| 109 |
- subject_update is changed |
| 110 |
- subject_update.sent != subject_update.proposed |
| 111 |
- subject_update.sent.vzSubj.attributes.prio == 'level2' |
| 112 |
- subject_update.sent.vzSubj.attributes.provMatchT == 'AtmostOne' |
| 113 |
- subject_present_2 is changed |
| 114 |
- subject_present_2.sent.vzSubj.attributes.consMatchT == 'All' |
| 115 |
- subject_present_2.sent.vzSubj.attributes.name == 'anstest2' |
| 116 |
- subject_present_2.sent.vzSubj.attributes.prio == 'level3' |
| 117 |
- subject_present_2.sent.vzSubj.attributes.revFltPorts == 'no' |
| 118 |
- present_missing_param is failed |
| 119 |
- 'present_missing_param.msg == "state is present but all of the following are missing: contract, subject"' |
| 120 |
|
| 121 |
- name: query tenant contract subject |
| 122 |
cisco.aci.aci_contract_subject: &aci_query_subject |
| 123 |
<<: *aci_subject_present |
| 124 |
state: query |
| 125 |
register: query_tenant_contract_subject |
| 126 |
|
| 127 |
- name: query tenant contract |
| 128 |
cisco.aci.aci_contract_subject: |
| 129 |
<<: *aci_query_subject |
| 130 |
subject: "{{ fakevar | default(omit) }}" |
| 131 |
register: query_tenant_contract |
| 132 |
|
| 133 |
- name: query tenant subject |
| 134 |
cisco.aci.aci_contract_subject: |
| 135 |
<<: *aci_query_subject |
| 136 |
contract: "{{ fakevar | default(omit) }}" |
| 137 |
register: query_tenant_subject |
| 138 |
|
| 139 |
- name: query contract subject |
| 140 |
cisco.aci.aci_contract_subject: |
| 141 |
<<: *aci_query_subject |
| 142 |
tenant: "{{ fakevar | default(omit) }}" |
| 143 |
register: query_contract_subject |
| 144 |
|
| 145 |
- name: query tenant |
| 146 |
cisco.aci.aci_contract_subject: |
| 147 |
<<: *aci_tenant_present |
| 148 |
state: query |
| 149 |
register: query_tenant |
| 150 |
|
| 151 |
- name: query contract |
| 152 |
cisco.aci.aci_contract_subject: |
| 153 |
<<: *aci_contract_present |
| 154 |
state: query |
| 155 |
tenant: "{{ fakevar | default(omit) }}" |
| 156 |
register: query_contract |
| 157 |
|
| 158 |
- name: query subject |
| 159 |
cisco.aci.aci_contract_subject: |
| 160 |
<<: *aci_query_subject |
| 161 |
tenant: "{{ fakevar | default(omit) }}" |
| 162 |
contract: "{{ fakevar | default(omit) }}" |
| 163 |
register: query_subject |
| 164 |
|
| 165 |
- name: query all |
| 166 |
cisco.aci.aci_contract_subject: |
| 167 |
<<: *aci_info |
| 168 |
state: query |
| 169 |
register: query_all |
| 170 |
|
| 171 |
- name: query assertions |
| 172 |
ansible.builtin.assert: |
| 173 |
that: |
| 174 |
- query_tenant_contract_subject is not changed |
| 175 |
- query_tenant_contract_subject.current | length == 1 |
| 176 |
- query_tenant_contract_subject.current.0.vzSubj.attributes.name == "anstest" |
| 177 |
- '"tn-ansible_test/brc-anstest/subj-anstest.json" in query_tenant_contract_subject.url' |
| 178 |
- query_tenant_contract is not changed |
| 179 |
- query_tenant_contract.current | length == 1 |
| 180 |
- query_tenant_contract.current.0.vzBrCP.attributes.name == "anstest" |
| 181 |
- query_tenant_contract.current.0.vzBrCP.children | length == 2 |
| 182 |
- '"?rsp-subtree=full&rsp-subtree-class=vzInTerm,vzOutTerm,vzSubj" in query_tenant_contract.filter_string' |
| 183 |
- '"tn-ansible_test/brc-anstest.json" in query_tenant_contract.url' |
| 184 |
- query_tenant_subject is not changed |
| 185 |
- query_tenant_subject.current | length == 1 |
| 186 |
- query_tenant_subject.current.0.fvTenant.attributes.name == "ansible_test" |
| 187 |
- query_tenant_subject.current.0.fvTenant.children.0.vzBrCP.children | length == 1 |
| 188 |
- query_tenant_subject.current.0.fvTenant.children.0.vzBrCP.children.0.vzSubj.attributes.name == "anstest" |
| 189 |
- '"rsp-subtree-filter=eq(vzSubj.name,\"anstest\")" in query_tenant_subject.filter_string' |
| 190 |
- '"rsp-subtree-class=vzInTerm,vzOutTerm,vzSubj" in query_tenant_subject.filter_string' |
| 191 |
- '"tn-ansible_test.json" in query_tenant_subject.url' |
| 192 |
- query_contract_subject is not changed |
| 193 |
- query_contract_subject.current.0.vzBrCP.attributes.name == "anstest" |
| 194 |
- query_contract_subject.current.0.vzBrCP.children | length == 1 |
| 195 |
- query_contract_subject.current.0.vzBrCP.children.0.vzSubj.attributes.name == "anstest" |
| 196 |
- '"query-target-filter=eq(vzBrCP.name,\"anstest\")" in query_contract_subject.filter_string' |
| 197 |
- '"rsp-subtree-filter=eq(vzSubj.name,\"anstest\")" in query_contract_subject.filter_string' |
| 198 |
- '"rsp-subtree-class=vzInTerm,vzOutTerm,vzSubj" in query_contract_subject.filter_string' |
| 199 |
- '"class/vzBrCP.json" in query_contract_subject.url' |
| 200 |
- query_tenant is not changed |
| 201 |
- query_tenant.current | length == 1 |
| 202 |
- query_tenant.current.0.fvTenant.attributes.name == "ansible_test" |
| 203 |
- '"rsp-subtree-class=vzBrCP,vzInTerm,vzOutTerm,vzSubj" in query_tenant.filter_string' |
| 204 |
- '"tn-ansible_test.json" in query_tenant.url' |
| 205 |
- query_contract is not changed |
| 206 |
- query_contract.current.0.vzBrCP.attributes.name == "anstest" |
| 207 |
- '"query-target-filter=eq(vzBrCP.name,\"anstest\")" in query_contract.filter_string' |
| 208 |
- '"rsp-subtree-class=vzInTerm,vzOutTerm,vzSubj" in query_contract.filter_string' |
| 209 |
- '"class/vzBrCP.json" in query_contract.url' |
| 210 |
- query_subject is not changed |
| 211 |
- query_subject.current.0.vzSubj.attributes.name == "anstest" |
| 212 |
- '"query-target-filter=eq(vzSubj.name,\"anstest\")" in query_subject.filter_string' |
| 213 |
- '"class/vzSubj.json" in query_subject.url' |
| 214 |
- query_all is not changed |
| 215 |
- query_all.current|length > 1 |
| 216 |
- query_all.current.0.vzSubj is defined |
| 217 |
- '"class/vzSubj.json" in query_all.url' |
| 218 |
|
| 219 |
- name: delete subject - check mode works |
| 220 |
cisco.aci.aci_contract_subject: &aci_subject_absent |
| 221 |
<<: *aci_subject_present |
| 222 |
state: absent |
| 223 |
check_mode: true |
| 224 |
register: subject_absent_check_mode |
| 225 |
|
| 226 |
- name: delete subject - deletion works |
| 227 |
cisco.aci.aci_contract_subject: |
| 228 |
<<: *aci_subject_absent |
| 229 |
register: subject_absent |
| 230 |
|
| 231 |
- name: delete subject - idempotency works |
| 232 |
cisco.aci.aci_contract_subject: |
| 233 |
<<: *aci_subject_absent |
| 234 |
register: subject_absent_idempotent |
| 235 |
|
| 236 |
- name: delete subject - cleanup |
| 237 |
cisco.aci.aci_contract_subject: |
| 238 |
<<: *aci_subject_present_2 |
| 239 |
state: absent |
| 240 |
|
| 241 |
- name: missing params - failure message works |
| 242 |
cisco.aci.aci_contract_subject: |
| 243 |
<<: *aci_subject_absent |
| 244 |
subject: "{{ fakevar | default(omit) }}" |
| 245 |
ignore_errors: true |
| 246 |
register: absent_missing_param |
| 247 |
|
| 248 |
- name: absent assertions |
| 249 |
ansible.builtin.assert: |
| 250 |
that: |
| 251 |
- subject_absent_check_mode is changed |
| 252 |
- subject_absent_check_mode.previous != [] |
| 253 |
- subject_absent_check_mode.proposed == {} |
| 254 |
- subject_absent is changed |
| 255 |
- subject_absent.previous == subject_absent_check_mode.previous |
| 256 |
- subject_absent_idempotent is not changed |
| 257 |
- subject_absent_idempotent.previous == [] |
| 258 |
- absent_missing_param is failed |
| 259 |
- 'absent_missing_param.msg == "state is absent but all of the following are missing: subject"' |
| 260 |
|
| 261 |
- name: create contract 1 |
| 262 |
cisco.aci.aci_contract: &aci_contract1 |
| 263 |
<<: *aci_tenant_present |
| 264 |
contract: contract1 |
| 265 |
register: contract_present |
| 266 |
|
| 267 |
- name: create subject both (check_mode) |
| 268 |
cisco.aci.aci_contract_subject: &aci_subject_both |
| 269 |
<<: *aci_contract1 |
| 270 |
subject: subjectboth |
| 271 |
check_mode: true |
| 272 |
register: cm_subject_present_both_default |
| 273 |
|
| 274 |
- name: create subject both |
| 275 |
cisco.aci.aci_contract_subject: |
| 276 |
<<: *aci_subject_both |
| 277 |
register: nm_subject_present_both_default |
| 278 |
|
| 279 |
- name: create subject both again with direction both set |
| 280 |
cisco.aci.aci_contract_subject: |
| 281 |
<<: *aci_subject_both |
| 282 |
apply_both_direction: both |
| 283 |
register: nm_subject_present_both_again |
| 284 |
|
| 285 |
- name: create subject one-way (check_mode) |
| 286 |
cisco.aci.aci_contract_subject: &aci_subject_one_way |
| 287 |
<<: *aci_contract1 |
| 288 |
subject: subjectoneway |
| 289 |
apply_both_direction: one-way |
| 290 |
check_mode: true |
| 291 |
register: cm_subject_present_one_way |
| 292 |
|
| 293 |
- name: create subject one-way |
| 294 |
cisco.aci.aci_contract_subject: |
| 295 |
<<: *aci_subject_one_way |
| 296 |
register: nm_subject_present_one_way |
| 297 |
|
| 298 |
- name: create subject one-way again |
| 299 |
cisco.aci.aci_contract_subject: |
| 300 |
<<: *aci_subject_one_way |
| 301 |
register: nm_subject_present_one_way_again |
| 302 |
|
| 303 |
- name: subject assertions |
| 304 |
ansible.builtin.assert: |
| 305 |
that: |
| 306 |
- cm_subject_present_both_default is changed |
| 307 |
- nm_subject_present_both_default is changed |
| 308 |
- nm_subject_present_both_default.current.0.vzSubj.attributes.name == "subjectboth" |
| 309 |
- nm_subject_present_both_again is not changed |
| 310 |
- cm_subject_present_one_way is changed |
| 311 |
- nm_subject_present_one_way is changed |
| 312 |
- nm_subject_present_one_way.current.0.vzSubj.attributes.name == "subjectoneway" |
| 313 |
- nm_subject_present_one_way_again is not changed |
| 314 |
|
| 315 |
- name: reverse subject both to one-way |
| 316 |
cisco.aci.aci_contract_subject: |
| 317 |
<<: *aci_subject_both |
| 318 |
apply_both_direction: one-way |
| 319 |
register: nm_subject_reverse_to_one_way |
| 320 |
ignore_errors: true |
| 321 |
|
| 322 |
- name: reverse subject one-way to both |
| 323 |
cisco.aci.aci_contract_subject: |
| 324 |
<<: *aci_subject_one_way |
| 325 |
apply_both_direction: both |
| 326 |
register: nm_subject_reverse_to_both |
| 327 |
ignore_errors: true |
| 328 |
|
| 329 |
- name: subject assertions |
| 330 |
ansible.builtin.assert: |
| 331 |
that: |
| 332 |
- nm_subject_reverse_to_one_way is not changed |
| 333 |
- nm_subject_reverse_to_one_way.msg == "Direction is not allowed, valid option is both." |
| 334 |
- nm_subject_reverse_to_both is not changed |
| 335 |
- nm_subject_reverse_to_both.msg == "Direction is not allowed, valid option is one-way." |
| 336 |
|
| 337 |
- name: subject both with qos and dscp |
| 338 |
cisco.aci.aci_contract_subject: |
| 339 |
<<: *aci_subject_both |
| 340 |
priority: level1 |
| 341 |
dscp: AF11 |
| 342 |
register: nm_subject_both_qos_dscp |
| 343 |
|
| 344 |
- name: subject both with change to qos |
| 345 |
cisco.aci.aci_contract_subject: |
| 346 |
<<: *aci_subject_both |
| 347 |
priority: unspecified |
| 348 |
register: nm_subject_both_qos_change |
| 349 |
|
| 350 |
- name: subject both with change to dscp |
| 351 |
cisco.aci.aci_contract_subject: |
| 352 |
<<: *aci_subject_both |
| 353 |
dscp: AF41 |
| 354 |
register: nm_subject_both_dscp_change |
| 355 |
|
| 356 |
- name: subject one-way with qos and dscp |
| 357 |
cisco.aci.aci_contract_subject: |
| 358 |
<<: *aci_subject_one_way |
| 359 |
priority_consumer_to_provider: level2 |
| 360 |
dscp_consumer_to_provider: AF12 |
| 361 |
priority_provider_to_consumer: level3 |
| 362 |
dscp_provider_to_consumer: CS4 |
| 363 |
register: nm_subject_one_way_qos_dscp |
| 364 |
|
| 365 |
- name: subject one-way with qos change |
| 366 |
cisco.aci.aci_contract_subject: |
| 367 |
<<: *aci_subject_one_way |
| 368 |
priority_consumer_to_provider: unspecified |
| 369 |
priority_provider_to_consumer: level1 |
| 370 |
register: nm_subject_one_way_qos_change |
| 371 |
|
| 372 |
- name: subject one-way with dscp change |
| 373 |
cisco.aci.aci_contract_subject: |
| 374 |
<<: *aci_subject_one_way |
| 375 |
dscp_consumer_to_provider: AF13 |
| 376 |
dscp_provider_to_consumer: CS1 |
| 377 |
register: nm_subject_one_way_dscp_change |
| 378 |
|
| 379 |
- name: subject assertions |
| 380 |
ansible.builtin.assert: |
| 381 |
that: |
| 382 |
- nm_subject_both_qos_dscp is changed |
| 383 |
- nm_subject_both_qos_dscp.current.0.vzSubj.attributes.prio == "level1" |
| 384 |
- nm_subject_both_qos_dscp.current.0.vzSubj.attributes.targetDscp == "AF11" |
| 385 |
- nm_subject_both_qos_change is changed |
| 386 |
- nm_subject_both_qos_change.current.0.vzSubj.attributes.prio == "unspecified" |
| 387 |
- nm_subject_both_qos_change.current.0.vzSubj.attributes.targetDscp == "AF11" |
| 388 |
- nm_subject_both_dscp_change is changed |
| 389 |
- nm_subject_both_dscp_change.current.0.vzSubj.attributes.prio == "unspecified" |
| 390 |
- nm_subject_both_dscp_change.current.0.vzSubj.attributes.targetDscp == "AF41" |
| 391 |
- nm_subject_one_way_qos_dscp is changed |
| 392 |
- nm_subject_one_way_qos_dscp.current.0.vzSubj.children.0.vzOutTerm.attributes.prio == "level3" |
| 393 |
- nm_subject_one_way_qos_dscp.current.0.vzSubj.children.0.vzOutTerm.attributes.targetDscp == "CS4" |
| 394 |
- nm_subject_one_way_qos_dscp.current.0.vzSubj.children.1.vzInTerm.attributes.prio == "level2" |
| 395 |
- nm_subject_one_way_qos_dscp.current.0.vzSubj.children.1.vzInTerm.attributes.targetDscp == "AF12" |
| 396 |
- nm_subject_one_way_qos_change is changed |
| 397 |
- nm_subject_one_way_qos_change.current.0.vzSubj.children.0.vzOutTerm.attributes.prio == "level1" |
| 398 |
- nm_subject_one_way_qos_change.current.0.vzSubj.children.0.vzOutTerm.attributes.targetDscp == "CS4" |
| 399 |
- nm_subject_one_way_qos_change.current.0.vzSubj.children.1.vzInTerm.attributes.prio == "unspecified" |
| 400 |
- nm_subject_one_way_qos_change.current.0.vzSubj.children.1.vzInTerm.attributes.targetDscp == "AF12" |
| 401 |
- nm_subject_one_way_dscp_change is changed |
| 402 |
- nm_subject_one_way_dscp_change.current.0.vzSubj.children.0.vzOutTerm.attributes.prio == "level1" |
| 403 |
- nm_subject_one_way_dscp_change.current.0.vzSubj.children.0.vzOutTerm.attributes.targetDscp == "CS1" |
| 404 |
- nm_subject_one_way_dscp_change.current.0.vzSubj.children.1.vzInTerm.attributes.prio == "unspecified" |
| 405 |
- nm_subject_one_way_dscp_change.current.0.vzSubj.children.1.vzInTerm.attributes.targetDscp == "AF13" |
| 406 |
|
| 407 |
- name: create OOB contract subject |
| 408 |
cisco.aci.aci_contract_subject: |
| 409 |
<<: *aci_info |
| 410 |
tenant: mgmt |
| 411 |
contract: ansible_test_oob_contract |
| 412 |
contract_type: oob |
| 413 |
subject: ansible_test_ctr_subj |
| 414 |
description: ansible test OOB subject |
| 415 |
register: nm_oob_subject |
| 416 |
|
| 417 |
- name: oob subject creation assertions |
| 418 |
ansible.builtin.assert: |
| 419 |
that: |
| 420 |
- nm_oob_subject is changed |
| 421 |
- nm_oob_subject.sent.vzSubj.attributes.name == "ansible_test_ctr_subj" |
| 422 |
- nm_oob_subject.sent.vzSubj.attributes.descr == "ansible test OOB subject" |
| 423 |
- nm_oob_subject.sent.vzSubj.attributes.dn == "uni/tn-mgmt/oobbrc-ansible_test_oob_contract/subj-ansible_test_ctr_subj" |
| 424 |
- nm_oob_subject.previous == [] |
| 425 |
- nm_oob_subject.current.0.vzSubj.attributes.name == "ansible_test_ctr_subj" |
| 426 |
- nm_oob_subject.current.0.vzSubj.attributes.descr == "ansible test OOB subject" |
| 427 |
- nm_oob_subject.current.0.vzSubj.attributes.dn == "uni/tn-mgmt/oobbrc-ansible_test_oob_contract/subj-ansible_test_ctr_subj" |
| 428 |
|
| 429 |
- name: update OOB contract subject |
| 430 |
cisco.aci.aci_contract_subject: |
| 431 |
<<: *aci_info |
| 432 |
tenant: mgmt |
| 433 |
contract: ansible_test_oob_contract |
| 434 |
contract_type: oob |
| 435 |
subject: ansible_test_ctr_subj |
| 436 |
description: updated ansible test OOB subject |
| 437 |
register: oob_subject_update |
| 438 |
|
| 439 |
- name: oob subject update assertions |
| 440 |
ansible.builtin.assert: |
| 441 |
that: |
| 442 |
- oob_subject_update is changed |
| 443 |
- oob_subject_update.sent.vzSubj.attributes.descr == "updated ansible test OOB subject" |
| 444 |
- oob_subject_update.current.0.vzSubj.attributes.name == "ansible_test_ctr_subj" |
| 445 |
- oob_subject_update.current.0.vzSubj.attributes.descr == "updated ansible test OOB subject" |
| 446 |
- oob_subject_update.current.0.vzSubj.attributes.dn == "uni/tn-mgmt/oobbrc-ansible_test_oob_contract/subj-ansible_test_ctr_subj" |
| 447 |
- oob_subject_update.previous.0.vzSubj.attributes.name == "ansible_test_ctr_subj" |
| 448 |
- oob_subject_update.previous.0.vzSubj.attributes.descr == "ansible test OOB subject" |
| 449 |
- oob_subject_update.previous.0.vzSubj.attributes.dn == "uni/tn-mgmt/oobbrc-ansible_test_oob_contract/subj-ansible_test_ctr_subj" |
| 450 |
|
| 451 |
- name: query OOB contract subject |
| 452 |
cisco.aci.aci_contract_subject: |
| 453 |
<<: *aci_info |
| 454 |
tenant: mgmt |
| 455 |
contract: ansible_test_oob_contract |
| 456 |
contract_type: oob |
| 457 |
subject: ansible_test_ctr_subj |
| 458 |
state: query |
| 459 |
register: oob_subject_query |
| 460 |
|
| 461 |
- name: oob subject query assertions |
| 462 |
ansible.builtin.assert: |
| 463 |
that: |
| 464 |
- oob_subject_query is not changed |
| 465 |
- oob_subject_query.sent == {} |
| 466 |
- oob_subject_query.current.0.vzSubj.attributes.name == "ansible_test_ctr_subj" |
| 467 |
- oob_subject_query.current.0.vzSubj.attributes.descr == "updated ansible test OOB subject" |
| 468 |
- oob_subject_query.current.0.vzSubj.attributes.dn == "uni/tn-mgmt/oobbrc-ansible_test_oob_contract/subj-ansible_test_ctr_subj" |
| 469 |
|
| 470 |
- name: delete OOB contract subject |
| 471 |
cisco.aci.aci_contract_subject: |
| 472 |
<<: *aci_info |
| 473 |
tenant: mgmt |
| 474 |
contract: ansible_test_oob_contract |
| 475 |
contract_type: oob |
| 476 |
subject: ansible_test_ctr_subj |
| 477 |
state: absent |
| 478 |
register: oob_subject_delete |
| 479 |
|
| 480 |
- name: oob subject deletion assertions |
| 481 |
ansible.builtin.assert: |
| 482 |
that: |
| 483 |
- oob_subject_delete is changed |
| 484 |
- oob_subject_delete.sent == {} |
| 485 |
- oob_subject_delete.previous.0.vzSubj.attributes.name == "ansible_test_ctr_subj" |
| 486 |
- oob_subject_delete.previous.0.vzSubj.attributes.descr == "updated ansible test OOB subject" |
| 487 |
- oob_subject_delete.previous.0.vzSubj.attributes.dn == "uni/tn-mgmt/oobbrc-ansible_test_oob_contract/subj-ansible_test_ctr_subj" |
| 488 |
- oob_subject_delete.current == [] |
| 489 |
|
| 490 |
always: |
| 491 |
- name: cleanup tenant |
| 492 |
cisco.aci.aci_tenant: |
| 493 |
<<: *aci_tenant_present |
| 494 |
state: absent |
| 495 |
when: tenant_present is changed |
| 496 |
|
| 497 |
- name: cleanup oob contract |
| 498 |
cisco.aci.aci_oob_contract: |
| 499 |
<<: *aci_info |
| 500 |
contract: ansible_test_oob_contract |
| 501 |
state: absent |