Debian Codegraph @

ansible_collections/microsoft/ad/tests/integration/targets/object/tasks/tests.yml

raw
1 - name: create contact object - check
2 object:
3 name: '{{ object_name }}'
4 type: contact
5 state: present
6 register: create_check
7 check_mode: true
8
9 - name: get result of create contact object - check
10 object_info:
11 identity: '{{ create_check.distinguished_name }}'
12 register: create_check_actual
13
14 - name: assert create contact object - check
15 assert:
16 that:
17 - create_check is changed
18 - create_check.distinguished_name == object_dn
19 - create_check.object_guid == '00000000-0000-0000-0000-000000000000'
20 - create_check_actual.objects == []
21
22 - name: create contact object
23 object:
24 name: '{{ object_name }}'
25 type: contact
26 state: present
27 register: create
28
29 - name: get result of create contact object
30 object_info:
31 identity: '{{ create_check.distinguished_name }}'
32 properties:
33 - objectClass
34 register: create_actual
35
36 - name: assert create contact object
37 assert:
38 that:
39 - create is changed
40 - create_actual.objects | length == 1
41 - create_actual.objects[0].ObjectClass == 'contact'
42 - create.distinguished_name == object_dn
43 - create.distinguished_name == create_actual.objects[0].DistinguishedName
44 - create.object_guid == create_actual.objects[0].ObjectGUID
45
46 - set_fact:
47 object_identity: '{{ create.object_guid }}'
48
49 - name: create contact object - idempotent
50 object:
51 name: '{{ object_name }}'
52 type: contact
53 state: present
54 register: create_again
55
56 - name: assert create contact object - idempotent
57 assert:
58 that:
59 - not create_again is changed
60 - create_again.distinguished_name == create_actual.objects[0].DistinguishedName
61 - create_again.object_guid == create_actual.objects[0].ObjectGUID
62
63 - name: fail to change type
64 object:
65 name: '{{ object_name }}'
66 state: present
67 type: failure
68 register: fail_change_type
69 failed_when: fail_change_type.msg != "Cannot change object type contact of existing object " ~ object_dn ~ " to failure"
70
71 - name: rename and set display name of object - check
72 object:
73 name: My, Contact 2
74 identity: '{{ object_identity }}'
75 display_name: Display Name
76 state: present
77 type: contact
78 register: rename_check
79 check_mode: true
80
81 - name: get result of create contact object - check
82 object_info:
83 identity: '{{ object_identity }}'
84 properties:
85 - displayName
86 - name
87 register: rename_check_actual
88
89 - name: assert rename and set display name of object - check
90 assert:
91 that:
92 - rename_check is changed
93 - rename_check.distinguished_name == 'CN=My\, Contact 2,' ~ setup_domain_info.output[0].defaultNamingContext
94 - rename_check.object_guid == object_identity
95 - rename_check_actual.objects[0].DisplayName == None
96 - rename_check_actual.objects[0].DistinguishedName == object_dn
97 - rename_check_actual.objects[0].Name == object_name
98
99 - name: rename and set display name of object
100 object:
101 name: My, Contact 2
102 identity: '{{ object_identity }}'
103 display_name: Display Name
104 state: present
105 type: contact
106 register: rename
107
108 - name: get result of create contact object
109 object_info:
110 identity: '{{ object_identity }}'
111 properties:
112 - displayName
113 - name
114 register: rename_actual
115
116 - name: assert rename and set display name of object
117 assert:
118 that:
119 - rename is changed
120 - rename.distinguished_name == 'CN=My\, Contact 2,' ~ setup_domain_info.output[0].defaultNamingContext
121 - rename.object_guid == object_identity
122 - rename_actual.objects[0].DisplayName == 'Display Name'
123 - rename_actual.objects[0].DistinguishedName == 'CN=My\, Contact 2,' ~ setup_domain_info.output[0].defaultNamingContext
124 - rename_actual.objects[0].Name == 'My, Contact 2'
125
126 - name: rename and set display name of object - idempotent
127 object:
128 name: My, Contact 2
129 identity: '{{ object_identity }}'
130 display_name: Display Name
131 state: present
132 type: contact
133 register: rename_again
134
135 - name: assert rename and set display name of object - idempotent
136 assert:
137 that:
138 - not rename_again is changed
139 - rename_again.distinguished_name == 'CN=My\, Contact 2,' ~ setup_domain_info.output[0].defaultNamingContext
140 - rename_again.object_guid == object_identity
141
142 - name: move and set description - check
143 object:
144 name: My, Contact 2
145 identity: '{{ object_identity }}'
146 path: CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
147 description: My Description
148 state: present
149 type: contact
150 register: move_check
151 check_mode: true
152
153 - name: move and set description - check
154 object_info:
155 identity: '{{ object_identity }}'
156 properties:
157 - description
158 - name
159 register: move_check_actual
160
161 - name: assert move and set description - check
162 assert:
163 that:
164 - move_check is changed
165 - move_check.distinguished_name == 'CN=My\, Contact 2,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
166 - move_check.object_guid == object_identity
167 - move_check_actual.objects[0].Description == None
168 - move_check_actual.objects[0].DistinguishedName == 'CN=My\, Contact 2,' ~ setup_domain_info.output[0].defaultNamingContext
169 - move_check_actual.objects[0].Name == 'My, Contact 2'
170
171 - name: move and set description
172 object:
173 name: My, Contact 2
174 identity: '{{ object_identity }}'
175 path: CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
176 description: My Description
177 state: present
178 type: contact
179 register: move
180
181 - name: move and set description
182 object_info:
183 identity: '{{ object_identity }}'
184 properties:
185 - description
186 - name
187 register: move_actual
188
189 - name: assert move and set description
190 assert:
191 that:
192 - move is changed
193 - move.distinguished_name == 'CN=My\, Contact 2,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
194 - move.object_guid == object_identity
195 - move_actual.objects[0].Description == 'My Description'
196 - move_actual.objects[0].DistinguishedName == 'CN=My\, Contact 2,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
197 - move_actual.objects[0].Name == 'My, Contact 2'
198
199 - name: move and set description - idempotent
200 object:
201 name: My, Contact 2
202 identity: '{{ object_identity }}'
203 path: CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
204 description: My Description
205 state: present
206 type: contact
207 register: move_again
208
209 - name: assert move and set description - idempotent
210 assert:
211 that:
212 - not move_again is changed
213 - move_again.distinguished_name == 'CN=My\, Contact 2,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
214 - move_again.object_guid == object_identity
215
216 - name: rename and move - check
217 object:
218 name: '{{ object_name }}'
219 identity: '{{ object_identity }}'
220 path: '{{ setup_domain_info.output[0].defaultNamingContext }}'
221 state: present
222 type: contact
223 register: rename_and_move_check
224 check_mode: true
225
226 - name: get result of rename and move - check
227 object_info:
228 identity: '{{ object_identity }}'
229 register: rename_and_move_check_actual
230
231 - name: assert rename and move - check
232 assert:
233 that:
234 - rename_and_move_check is changed
235 - rename_and_move_check.distinguished_name == object_dn
236 - rename_and_move_check.object_guid == object_identity
237 - rename_and_move_check_actual.objects[0].DistinguishedName == 'CN=My\, Contact 2,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
238 - rename_and_move_check_actual.objects[0].Name == 'My, Contact 2'
239
240 - name: rename and move
241 object:
242 name: '{{ object_name }}'
243 identity: '{{ object_identity }}'
244 path: '{{ setup_domain_info.output[0].defaultNamingContext }}'
245 state: present
246 type: contact
247 register: rename_and_move
248
249 - name: get result of rename and move
250 object_info:
251 identity: '{{ object_identity }}'
252 register: rename_and_move_actual
253
254 - name: assert rename and move
255 assert:
256 that:
257 - rename_and_move is changed
258 - rename_and_move.distinguished_name == object_dn
259 - rename_and_move.object_guid == object_identity
260 - rename_and_move_actual.objects[0].DistinguishedName == object_dn
261 - rename_and_move_actual.objects[0].Name == object_name
262
263 - name: remove object by name - check
264 object:
265 name: '{{ object_name }}'
266 state: absent
267 register: remove_check
268 check_mode: true
269
270 - name: get result of remove by name - check
271 object_info:
272 identity: '{{ object_identity }}'
273 register: remove_check_actual
274
275 - name: assert remove object by name - check
276 assert:
277 that:
278 - remove_check is changed
279 - remove_check.distinguished_name == object_dn
280 - remove_check.object_guid == object_identity
281 - remove_check_actual.objects | length == 1
282
283 - name: remove object by name
284 object:
285 name: '{{ object_name }}'
286 state: absent
287 register: remove
288
289 - name: get result of remove by name
290 object_info:
291 identity: '{{ object_identity }}'
292 register: remove_actual
293
294 - name: assert remove object by name - check
295 assert:
296 that:
297 - remove is changed
298 - remove.distinguished_name == object_dn
299 - remove.object_guid == object_identity
300 - remove_actual.objects == []
301
302 - name: remove object by name - idempotent
303 object:
304 name: '{{ object_name }}'
305 state: absent
306 register: remove_again
307
308 - name: assert remove object by name - check
309 assert:
310 that:
311 - not remove_again is changed
312 - remove_again.distinguished_name == None
313 - remove_again.object_guid == None
314
315 - name: create object protected from deletion
316 object:
317 name: My, Container
318 state: present
319 type: organizationalUnit
320 protect_from_deletion: true
321 register: create_deletion
322
323 - set_fact:
324 object_identity: '{{ create_deletion.object_guid }}'
325
326 - name: get result of create object protected from deletion
327 object_info:
328 identity: '{{ object_identity }}'
329 properties:
330 - ProtectedFromAccidentalDeletion
331 register: create_deletion_actual
332
333 - name: assert create object protected from deletion
334 assert:
335 that:
336 - create_deletion is changed
337 - create_deletion.distinguished_name == 'OU=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
338 - create_deletion_actual.objects[0].ProtectedFromAccidentalDeletion == true
339
340 - name: unset protect from deletion
341 object:
342 name: My, Container
343 state: present
344 type: organizationalUnit
345 protect_from_deletion: false
346 register: unset_deletion
347
348 - name: get result of unset protect from deletion
349 object_info:
350 identity: '{{ object_identity }}'
351 properties:
352 - ProtectedFromAccidentalDeletion
353 register: unset_deletion_actual
354
355 - name: assert set protect from deletion
356 assert:
357 that:
358 - unset_deletion is changed
359 - unset_deletion.distinguished_name == 'OU=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
360 - unset_deletion_actual.objects[0].ProtectedFromAccidentalDeletion == false
361
362 - name: set protect from deletion
363 object:
364 name: My, Container
365 state: present
366 type: organizationalUnit
367 protect_from_deletion: true
368 register: set_deletion
369
370 - name: get result of set protect from deletion
371 object_info:
372 identity: '{{ object_identity }}'
373 properties:
374 - ProtectedFromAccidentalDeletion
375 register: set_deletion_actual
376
377 - name: assert set protect from deletion
378 assert:
379 that:
380 - set_deletion is changed
381 - set_deletion.distinguished_name == 'OU=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
382 - set_deletion_actual.objects[0].ProtectedFromAccidentalDeletion == true
383
384 - name: create sub ous for move test
385 ou:
386 name: '{{ item }}'
387 path: '{{ set_deletion.distinguished_name }}'
388 state: present
389 protect_from_deletion: true
390 register: sub_ous
391 loop:
392 - SubOU
393 - TestOU
394
395 - name: move and rename object that is protected from deletion - check
396 object:
397 name: TestOU 2
398 path: '{{ sub_ous.results[0].distinguished_name }}'
399 identity: '{{ sub_ous.results[1].object_guid }}'
400 type: organizationalUnit
401 register: move_ou_check
402 check_mode: true
403
404 - name: get result of move and rename object that is protected from deletion - check
405 object_info:
406 identity: '{{ sub_ous.results[1].object_guid }}'
407 properties:
408 - ProtectedFromAccidentalDeletion
409 register: move_ou_check_actual
410
411 - name: assert move and rename object that is protected from deletion - check
412 assert:
413 that:
414 - move_ou_check is changed
415 - move_ou_check.distinguished_name == 'OU=TestOU 2,' ~ sub_ous.results[0].distinguished_name
416 - move_ou_check_actual.objects[0].Name == 'TestOU'
417 - move_ou_check_actual.objects[0].DistinguishedName == sub_ous.results[1].distinguished_name
418 - move_ou_check_actual.objects[0].ProtectedFromAccidentalDeletion == true
419
420 - name: move and rename object that is protected from deletion
421 object:
422 name: TestOU 2
423 path: '{{ sub_ous.results[0].distinguished_name }}'
424 identity: '{{ sub_ous.results[1].object_guid }}'
425 type: organizationalUnit
426 register: move_ou
427
428 - name: get result of move and rename object that is protected from deletion
429 object_info:
430 identity: '{{ sub_ous.results[1].object_guid }}'
431 properties:
432 - ProtectedFromAccidentalDeletion
433 register: move_ou_actual
434
435 - name: assert move and rename object that is protected from deletion
436 assert:
437 that:
438 - move_ou is changed
439 - move_ou.distinguished_name == 'OU=TestOU 2,' ~ sub_ous.results[0].distinguished_name
440 - move_ou_actual.objects[0].Name == 'TestOU 2'
441 - move_ou_actual.objects[0].DistinguishedName == 'OU=TestOU 2,' ~ sub_ous.results[0].distinguished_name
442 - move_ou_actual.objects[0].ProtectedFromAccidentalDeletion == true
443
444 - name: do not move object in non default path without path - check
445 object:
446 name: TestOU 2
447 identity: '{{ sub_ous.results[1].object_guid }}'
448 type: organizationalUnit
449 attributes:
450 set:
451 description: Test comment
452 register: dont_move_no_path_check
453 check_mode: true
454
455 - name: get result of do not move object in non default path without path - check
456 object_info:
457 identity: '{{ sub_ous.results[1].object_guid }}'
458 properties:
459 - description
460 register: dont_move_no_path_check_actual
461
462 - name: assert do not move object in non default path without path - check
463 assert:
464 that:
465 - dont_move_no_path_check is changed
466 - dont_move_no_path_check.distinguished_name == 'OU=TestOU 2,' ~ sub_ous.results[0].distinguished_name
467 - dont_move_no_path_check_actual.objects[0].Name == 'TestOU 2'
468 - dont_move_no_path_check_actual.objects[0].DistinguishedName == 'OU=TestOU 2,' ~ sub_ous.results[0].distinguished_name
469 - dont_move_no_path_check_actual.objects[0].Description == None
470
471 - name: do not move object in non default path without path
472 object:
473 name: TestOU 2
474 identity: '{{ sub_ous.results[1].object_guid }}'
475 type: organizationalUnit
476 attributes:
477 set:
478 description: Test comment
479 register: dont_move_no_path
480
481 - name: get result of do not move object in non default path without path
482 object_info:
483 identity: '{{ sub_ous.results[1].object_guid }}'
484 properties:
485 - description
486 register: dont_move_no_path_actual
487
488 - name: assert do not move object in non default path without path - check
489 assert:
490 that:
491 - dont_move_no_path is changed
492 - dont_move_no_path.distinguished_name == 'OU=TestOU 2,' ~ sub_ous.results[0].distinguished_name
493 - dont_move_no_path_actual.objects[0].Name == 'TestOU 2'
494 - dont_move_no_path_actual.objects[0].DistinguishedName == 'OU=TestOU 2,' ~ sub_ous.results[0].distinguished_name
495 - dont_move_no_path_actual.objects[0].Description == 'Test comment'
496
497 - name: remove object that is protected from deletion - check
498 object:
499 name: My, Container
500 state: absent
501 type: organizationalUnit
502 register: remove_deletion_check
503 check_mode: true
504
505 - name: get result of remove object that is protected from deletion - check
506 object_info:
507 identity: '{{ object_identity }}'
508 properties:
509 - ProtectedFromAccidentalDeletion
510 register: remove_deletion_actual_check
511
512 - name: assert remove object that is protected from deletion - check
513 assert:
514 that:
515 - remove_deletion_check is changed
516 - remove_deletion_check.distinguished_name == 'OU=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
517 - remove_deletion_actual_check.objects[0].ProtectedFromAccidentalDeletion == true
518
519 - name: remove object that is protected from deletion
520 object:
521 name: My, Container
522 state: absent
523 type: organizationalUnit
524 register: remove_deletion
525
526 - name: get result of remove object that is protected from deletion
527 object_info:
528 identity: '{{ object_identity }}'
529 register: remove_deletion_actual
530
531 - name: assert remove object that is protected from deletion
532 assert:
533 that:
534 - remove_deletion is changed
535 - remove_deletion.distinguished_name == 'OU=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
536 - remove_deletion_actual.objects == []
537
538 - name: create object with custom path, description, and display_name
539 object:
540 name: My, Container
541 description: Test Description
542 display_name: Display Name
543 path: CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
544 state: present
545 type: container
546 register: create_custom
547
548 - set_fact:
549 object_identity: '{{ create_custom.object_guid }}'
550
551 - name: get result of create object with custom path, description, and display_name
552 object_info:
553 identity: '{{ object_identity }}'
554 properties:
555 - description
556 - displayName
557 - objectClass
558 register: create_custom_actual
559
560 - name: assert create object with custom path, description, and display_name
561 assert:
562 that:
563 - create_custom is changed
564 - create_custom.distinguished_name == 'CN=My\, Container,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
565 - create_custom.object_guid == object_identity
566 - create_custom_actual.objects[0].Description == 'Test Description'
567 - create_custom_actual.objects[0].DisplayName == 'Display Name'
568 - create_custom_actual.objects[0].ObjectClass == 'container'
569
570 - name: create child object in container with attributes
571 object:
572 name: Contact
573 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
574 description: Test Description
575 display_name: Display Name
576 attributes:
577 add:
578 ansible-BoolSingle: false
579 ansible-BoolMulti:
580 - false
581 - true
582 ansible-BytesSingle:
583 type: bytes
584 value: Zm9v
585 ansible-BytesMulti:
586 - type: bytes
587 value: Zm9v
588 - type: bytes
589 value: YmFy
590 ansible-DateTimeSingle:
591 type: date_time
592 value: '1970-01-01T00:00:00Z'
593 ansible-DateTimeMulti:
594 - type: date_time
595 value: '1970-01-01T00:00:00+01:00'
596 - type: date_time
597 value: '1601-01-01T00:00:00.1-01:00'
598 ansible-IntSingle: 0
599 ansible-IntMulti:
600 - 0
601 - 1
602 ansible-SDSingle:
603 type: security_descriptor
604 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
605 ansible-SDMulti:
606 - type: security_descriptor
607 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)
608 - type: security_descriptor
609 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)
610 ansible-StringSingle: single
611 ansible-StringMulti:
612 - multi 1
613 - multi 2
614 type: contact
615 state: present
616 register: sub_object
617
618 - name: get result of child object attributes
619 object_info:
620 identity: '{{ sub_object.object_guid }}'
621 properties:
622 - ansible-BoolSingle
623 - ansible-BoolMulti
624 - ansible-BytesSingle
625 - ansible-BytesMulti
626 - ansible-DateTimeSingle
627 - ansible-DateTimeMulti
628 - ansible-IntSingle
629 - ansible-IntMulti
630 - ansible-SDSingle
631 - ansible-SDMulti
632 - ansible-StringSingle
633 - ansible-StringMulti
634 register: sub_object_actual
635
636 - name: assert create child object in container with attributes
637 assert:
638 that:
639 - sub_object is changed
640 - sub_object.distinguished_name == 'CN=Contact,CN=My\, Container,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
641 - sub_object_actual.objects[0]['ansible-BoolSingle'] == False
642 - sub_object_actual.objects[0]['ansible-BoolMulti'] | length == 2
643 - True in sub_object_actual.objects[0]['ansible-BoolMulti']
644 - False in sub_object_actual.objects[0]['ansible-BoolMulti']
645 - sub_object_actual.objects[0]['ansible-BytesSingle'] == "Zm9v"
646 - sub_object_actual.objects[0]['ansible-BytesMulti'] | length == 2
647 - "'YmFy' in sub_object_actual.objects[0]['ansible-BytesMulti']"
648 - "'Zm9v' in sub_object_actual.objects[0]['ansible-BytesMulti']"
649 - sub_object_actual.objects[0]['ansible-DateTimeSingle'] == "1970-01-01T00:00:00.0000000Z"
650 - sub_object_actual.objects[0]['ansible-DateTimeMulti'] | length == 2
651 - "'1601-01-01T01:00:00.0000000Z' in sub_object_actual.objects[0]['ansible-DateTimeMulti']"
652 - "'1969-12-31T23:00:00.0000000Z' in sub_object_actual.objects[0]['ansible-DateTimeMulti']"
653 - sub_object_actual.objects[0]['ansible-IntSingle'] == 0
654 - sub_object_actual.objects[0]['ansible-IntMulti'] | length == 2
655 - 0 in sub_object_actual.objects[0]['ansible-IntMulti']
656 - 1 in sub_object_actual.objects[0]['ansible-IntMulti']
657 - sub_object_actual.objects[0]['ansible-SDSingle'] == "O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)"
658 - sub_object_actual.objects[0]['ansible-SDMulti'] | length == 2
659 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in sub_object_actual.objects[0]['ansible-SDMulti']"
660 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)' in sub_object_actual.objects[0]['ansible-SDMulti']"
661 - sub_object_actual.objects[0]['ansible-StringSingle'] == "single"
662 - sub_object_actual.objects[0]['ansible-StringMulti'] | length == 2
663 - "'multi 1' in sub_object_actual.objects[0]['ansible-StringMulti']"
664 - "'multi 2' in sub_object_actual.objects[0]['ansible-StringMulti']"
665
666 - name: add attribute - check
667 object:
668 name: Contact
669 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
670 type: contact
671 description: test description
672 display_name: display name
673 attributes:
674 add:
675 ansible-BoolMulti:
676 - false
677 - true
678 ansible-BytesMulti:
679 - type: bytes
680 value: Zm9v
681 - type: bytes
682 value: dGVzdA==
683 - type: bytes
684 value: Y2FmZQ==
685 ansible-DateTimeMulti:
686 - type: date_time
687 value: '1970-01-01T00:00:00+01:00'
688 - type: date_time
689 value: '1970-01-01T00:00:00'
690 - type: date_time
691 value: '2023-01-17T16:00:31+00:30'
692 ansible-IntMulti:
693 - 0
694 - 2
695 - 3
696 ansible-SDMulti:
697 - type: security_descriptor
698 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)
699 - type: security_descriptor
700 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
701 - type: security_descriptor
702 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)
703 ansible-StringMulti:
704 - multi 1
705 - '3'
706 - '4'
707 state: present
708 register: add_attr_check
709 check_mode: true
710
711 - name: get result of add attribute - check
712 object_info:
713 identity: '{{ sub_object.object_guid }}'
714 properties:
715 - ansible-BoolMulti
716 - ansible-BytesMulti
717 - ansible-DateTimeMulti
718 - ansible-IntMulti
719 - ansible-SDMulti
720 - ansible-StringMulti
721 register: add_attr_check_actual
722
723 - name: assert add attribute - check
724 assert:
725 that:
726 - add_attr_check is changed
727 - add_attr_check_actual.objects[0]['ansible-BoolMulti'] | length == 2
728 - True in add_attr_check_actual.objects[0]['ansible-BoolMulti']
729 - False in add_attr_check_actual.objects[0]['ansible-BoolMulti']
730 - add_attr_check_actual.objects[0]['ansible-BytesMulti'] | length == 2
731 - "'YmFy' in add_attr_check_actual.objects[0]['ansible-BytesMulti']"
732 - "'Zm9v' in add_attr_check_actual.objects[0]['ansible-BytesMulti']"
733 - add_attr_check_actual.objects[0]['ansible-DateTimeMulti'] | length == 2
734 - "'1601-01-01T01:00:00.0000000Z' in add_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
735 - "'1969-12-31T23:00:00.0000000Z' in add_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
736 - add_attr_check_actual.objects[0]['ansible-IntMulti'] | length == 2
737 - 0 in add_attr_check_actual.objects[0]['ansible-IntMulti']
738 - 1 in add_attr_check_actual.objects[0]['ansible-IntMulti']
739 - add_attr_check_actual.objects[0]['ansible-SDMulti'] | length == 2
740 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in add_attr_check_actual.objects[0]['ansible-SDMulti']"
741 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)' in add_attr_check_actual.objects[0]['ansible-SDMulti']"
742 - add_attr_check_actual.objects[0]['ansible-StringMulti'] | length == 2
743 - "'multi 1' in add_attr_check_actual.objects[0]['ansible-StringMulti']"
744 - "'multi 2' in add_attr_check_actual.objects[0]['ansible-StringMulti']"
745
746 - name: add attribute
747 object:
748 name: Contact
749 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
750 type: contact
751 description: test description
752 display_name: display name
753 attributes:
754 add:
755 ansible-BoolMulti:
756 - false
757 - true
758 ansible-BytesMulti:
759 - type: bytes
760 value: Zm9v
761 - type: bytes
762 value: dGVzdA==
763 - type: bytes
764 value: Y2FmZQ==
765 ansible-DateTimeMulti:
766 - type: date_time
767 value: '1970-01-01T00:00:00+01:00'
768 - type: date_time
769 value: '1970-01-01T00:00:00'
770 - type: date_time
771 value: '2023-01-17T16:00:31+00:30'
772 ansible-IntMulti:
773 - 0
774 - 2
775 - 3
776 ansible-SDMulti:
777 - type: security_descriptor
778 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)
779 - type: security_descriptor
780 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
781 - type: security_descriptor
782 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)
783 ansible-StringMulti:
784 - multi 1
785 - '3'
786 - '4'
787 state: present
788 register: add_attr
789
790 - name: get result of add attribute
791 object_info:
792 identity: '{{ sub_object.object_guid }}'
793 properties:
794 - ansible-BoolMulti
795 - ansible-BytesMulti
796 - ansible-DateTimeMulti
797 - ansible-IntMulti
798 - ansible-SDMulti
799 - ansible-StringMulti
800 register: add_attr_actual
801
802 - name: assert add attribute
803 assert:
804 that:
805 - add_attr is changed
806 - add_attr_actual.objects[0]['ansible-BoolMulti'] | length == 2
807 - True in add_attr_actual.objects[0]['ansible-BoolMulti']
808 - False in add_attr_actual.objects[0]['ansible-BoolMulti']
809 - add_attr_actual.objects[0]['ansible-BytesMulti'] | length == 4
810 - "'YmFy' in add_attr_actual.objects[0]['ansible-BytesMulti']"
811 - "'Zm9v' in add_attr_actual.objects[0]['ansible-BytesMulti']"
812 - "'dGVzdA==' in add_attr_actual.objects[0]['ansible-BytesMulti']"
813 - "'Y2FmZQ==' in add_attr_actual.objects[0]['ansible-BytesMulti']"
814 - add_attr_actual.objects[0]['ansible-DateTimeMulti'] | length == 4
815 - "'1601-01-01T01:00:00.0000000Z' in add_attr_actual.objects[0]['ansible-DateTimeMulti']"
816 - "'1969-12-31T23:00:00.0000000Z' in add_attr_actual.objects[0]['ansible-DateTimeMulti']"
817 - "'1970-01-01T00:00:00.0000000Z' in add_attr_actual.objects[0]['ansible-DateTimeMulti']"
818 - "'2023-01-17T15:30:31.0000000Z' in add_attr_actual.objects[0]['ansible-DateTimeMulti']"
819 - add_attr_actual.objects[0]['ansible-IntMulti'] | length == 4
820 - 0 in add_attr_actual.objects[0]['ansible-IntMulti']
821 - 1 in add_attr_actual.objects[0]['ansible-IntMulti']
822 - 2 in add_attr_actual.objects[0]['ansible-IntMulti']
823 - 3 in add_attr_actual.objects[0]['ansible-IntMulti']
824 - add_attr_actual.objects[0]['ansible-SDMulti'] | length == 4
825 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in add_attr_actual.objects[0]['ansible-SDMulti']"
826 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)' in add_attr_actual.objects[0]['ansible-SDMulti']"
827 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)' in add_attr_actual.objects[0]['ansible-SDMulti']"
828 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)' in add_attr_actual.objects[0]['ansible-SDMulti']"
829 - add_attr_actual.objects[0]['ansible-StringMulti'] | length == 4
830 - "'multi 1' in add_attr_actual.objects[0]['ansible-StringMulti']"
831 - "'multi 2' in add_attr_actual.objects[0]['ansible-StringMulti']"
832 - "'3' in add_attr_actual.objects[0]['ansible-StringMulti']"
833 - "'4' in add_attr_actual.objects[0]['ansible-StringMulti']"
834
835 - name: add attribute - idempotent
836 object:
837 name: Contact
838 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
839 type: contact
840 description: test description
841 display_name: display name
842 attributes:
843 add:
844 ansible-BoolMulti:
845 - false
846 - true
847 ansible-BytesMulti:
848 - type: bytes
849 value: Zm9v
850 - type: bytes
851 value: dGVzdA==
852 - type: bytes
853 value: Y2FmZQ==
854 ansible-DateTimeMulti:
855 - type: date_time
856 value: '1970-01-01T00:00:00+01:00'
857 - type: date_time
858 value: '1970-01-01T00:00:00'
859 - type: date_time
860 value: '2023-01-17T16:00:31+00:30'
861 ansible-IntMulti:
862 - 0
863 - 2
864 - 3
865 ansible-SDMulti:
866 - type: security_descriptor
867 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)
868 - type: security_descriptor
869 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
870 - type: security_descriptor
871 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)
872 ansible-StringMulti:
873 - multi 1
874 - '3'
875 - '4'
876 state: present
877 register: add_attr_again
878
879 - name: assert add attribute - idempotent
880 assert:
881 that:
882 - not add_attr_again is changed
883
884 - name: remove attribute - check
885 object:
886 name: Contact
887 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
888 type: contact
889 attributes:
890 remove:
891 ansible-BoolMulti:
892 - type: bool
893 value: '' # Will be false when casted
894 ansible-BytesMulti:
895 - type: bytes
896 value: dGVzdA==
897 - type: bytes
898 value: Y2FmZQ==
899 ansible-DateTimeMulti:
900 - type: date_time
901 value: '1970-01-01T00:00:00'
902 - type: date_time
903 value: '2023-01-17T16:00:31+00:30'
904 ansible-IntMulti:
905 - type: int
906 value: '2'
907 - type: raw
908 value: 3
909 ansible-SDMulti:
910 - type: security_descriptor
911 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
912 - type: security_descriptor
913 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)
914 ansible-StringMulti:
915 - multi 1
916 - type: string
917 value: 3
918 - type: raw
919 value: '4'
920 state: present
921 register: remove_attr_check
922 check_mode: true
923
924 - name: get result of remove attribute - check
925 object_info:
926 identity: '{{ sub_object.object_guid }}'
927 properties:
928 - ansible-BoolMulti
929 - ansible-BytesMulti
930 - ansible-DateTimeMulti
931 - ansible-IntMulti
932 - ansible-SDMulti
933 - ansible-StringMulti
934 register: remove_attr_check_actual
935
936 - name: assert remove attribute - check
937 assert:
938 that:
939 - remove_attr_check is changed
940 - remove_attr_check_actual.objects[0]['ansible-BoolMulti'] | length == 2
941 - True in remove_attr_check_actual.objects[0]['ansible-BoolMulti']
942 - False in remove_attr_check_actual.objects[0]['ansible-BoolMulti']
943 - remove_attr_check_actual.objects[0]['ansible-BytesMulti'] | length == 4
944 - "'YmFy' in remove_attr_check_actual.objects[0]['ansible-BytesMulti']"
945 - "'Zm9v' in remove_attr_check_actual.objects[0]['ansible-BytesMulti']"
946 - "'dGVzdA==' in remove_attr_check_actual.objects[0]['ansible-BytesMulti']"
947 - "'Y2FmZQ==' in remove_attr_check_actual.objects[0]['ansible-BytesMulti']"
948 - remove_attr_check_actual.objects[0]['ansible-DateTimeMulti'] | length == 4
949 - "'1601-01-01T01:00:00.0000000Z' in remove_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
950 - "'1969-12-31T23:00:00.0000000Z' in remove_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
951 - "'1970-01-01T00:00:00.0000000Z' in remove_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
952 - "'2023-01-17T15:30:31.0000000Z' in remove_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
953 - remove_attr_check_actual.objects[0]['ansible-IntMulti'] | length == 4
954 - 0 in remove_attr_check_actual.objects[0]['ansible-IntMulti']
955 - 1 in remove_attr_check_actual.objects[0]['ansible-IntMulti']
956 - 2 in remove_attr_check_actual.objects[0]['ansible-IntMulti']
957 - 3 in remove_attr_check_actual.objects[0]['ansible-IntMulti']
958 - remove_attr_check_actual.objects[0]['ansible-SDMulti'] | length == 4
959 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in remove_attr_check_actual.objects[0]['ansible-SDMulti']"
960 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)' in remove_attr_check_actual.objects[0]['ansible-SDMulti']"
961 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)' in remove_attr_check_actual.objects[0]['ansible-SDMulti']"
962 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)' in remove_attr_check_actual.objects[0]['ansible-SDMulti']"
963 - remove_attr_check_actual.objects[0]['ansible-StringMulti'] | length == 4
964 - "'multi 1' in remove_attr_check_actual.objects[0]['ansible-StringMulti']"
965 - "'multi 2' in remove_attr_check_actual.objects[0]['ansible-StringMulti']"
966 - "'3' in remove_attr_check_actual.objects[0]['ansible-StringMulti']"
967 - "'4' in remove_attr_check_actual.objects[0]['ansible-StringMulti']"
968
969 - name: remove attribute
970 object:
971 name: Contact
972 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
973 type: contact
974 attributes:
975 remove:
976 ansible-BoolMulti:
977 - type: bool
978 value: '' # Will be false when casted
979 ansible-BytesMulti:
980 - type: bytes
981 value: dGVzdA==
982 - type: bytes
983 value: Y2FmZQ==
984 ansible-DateTimeMulti:
985 - type: date_time
986 value: '1970-01-01T00:00:00'
987 - type: date_time
988 value: '2023-01-17T16:00:31+00:30'
989 ansible-IntMulti:
990 - type: int
991 value: '2'
992 - type: raw
993 value: 3
994 ansible-SDMulti:
995 - type: security_descriptor
996 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
997 - type: security_descriptor
998 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)
999 ansible-StringMulti:
1000 - type: string
1001 value: 3
1002 - type: raw
1003 value: '4'
1004 state: present
1005 register: remove_attr
1006
1007 - name: get result of remove attribute
1008 object_info:
1009 identity: '{{ sub_object.object_guid }}'
1010 properties:
1011 - ansible-BoolMulti
1012 - ansible-BytesMulti
1013 - ansible-DateTimeMulti
1014 - ansible-IntMulti
1015 - ansible-SDMulti
1016 - ansible-StringMulti
1017 register: remove_attr_actual
1018
1019 - name: assert remove attribute
1020 assert:
1021 that:
1022 - remove_attr is changed
1023 - remove_attr_actual.objects[0]['ansible-BoolMulti'] == [True]
1024 - remove_attr_actual.objects[0]['ansible-BytesMulti'] | length == 2
1025 - "'YmFy' in remove_attr_actual.objects[0]['ansible-BytesMulti']"
1026 - "'Zm9v' in remove_attr_actual.objects[0]['ansible-BytesMulti']"
1027 - remove_attr_actual.objects[0]['ansible-DateTimeMulti'] | length == 2
1028 - "'1601-01-01T01:00:00.0000000Z' in remove_attr_actual.objects[0]['ansible-DateTimeMulti']"
1029 - "'1969-12-31T23:00:00.0000000Z' in remove_attr_actual.objects[0]['ansible-DateTimeMulti']"
1030 - remove_attr_actual.objects[0]['ansible-IntMulti'] | length == 2
1031 - 0 in remove_attr_actual.objects[0]['ansible-IntMulti']
1032 - 1 in remove_attr_actual.objects[0]['ansible-IntMulti']
1033 - remove_attr_actual.objects[0]['ansible-SDMulti'] | length == 2
1034 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in remove_attr_actual.objects[0]['ansible-SDMulti']"
1035 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)' in remove_attr_actual.objects[0]['ansible-SDMulti']"
1036 - remove_attr_actual.objects[0]['ansible-StringMulti'] | length == 2
1037 - "'multi 1' in remove_attr_actual.objects[0]['ansible-StringMulti']"
1038 - "'multi 2' in remove_attr_actual.objects[0]['ansible-StringMulti']"
1039
1040 - name: remove attribute - idempotent
1041 object:
1042 name: Contact
1043 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1044 type: contact
1045 attributes:
1046 remove:
1047 ansible-BoolMulti:
1048 - type: bool
1049 value: '' # Will be false when casted
1050 ansible-BytesMulti:
1051 - type: bytes
1052 value: dGVzdA==
1053 - type: bytes
1054 value: Y2FmZQ==
1055 ansible-DateTimeMulti:
1056 - type: date_time
1057 value: '1970-01-01T00:00:00'
1058 - type: date_time
1059 value: '2023-01-17T16:00:31+00:30'
1060 ansible-IntMulti:
1061 - type: int
1062 value: '2'
1063 - type: raw
1064 value: 3
1065 ansible-SDMulti:
1066 - type: security_descriptor
1067 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
1068 - type: security_descriptor
1069 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DG)
1070 ansible-StringMulti:
1071 - type: string
1072 value: 3
1073 - type: raw
1074 value: '4'
1075 state: present
1076 register: remove_attr_again
1077
1078 - name: assert remove attribute - idempotent
1079 assert:
1080 that:
1081 - not remove_attr_again is changed
1082
1083 - name: set attribute - check
1084 object:
1085 name: Contact
1086 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1087 type: contact
1088 attributes:
1089 set:
1090 ansible-BoolSingle: true
1091 ansible-BoolMulti: false
1092 ansible-BytesSingle:
1093 type: bytes
1094 value: YmFy
1095 ansible-BytesMulti:
1096 - type: bytes
1097 value: dGVzdA==
1098 - type: bytes
1099 value: YmFy
1100 ansible-DateTimeSingle:
1101 type: date_time
1102 value: '1601-01-01T00:00:00Z'
1103 ansible-DateTimeMulti:
1104 - type: date_time
1105 value: '1970-01-01T00:00:00'
1106 - type: date_time
1107 value: '1601-01-01T00:01:00.1-02:00'
1108 ansible-IntSingle: 1
1109 ansible-IntMulti:
1110 - 0
1111 - 3
1112 ansible-SDSingle:
1113 type: security_descriptor
1114 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)
1115 ansible-SDMulti:
1116 - type: security_descriptor
1117 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
1118 - type: security_descriptor
1119 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)
1120 ansible-StringSingle: Single
1121 ansible-StringMulti:
1122 - multi 1
1123 - multi 3
1124 state: present
1125 register: set_attr_check
1126 check_mode: true
1127
1128 - name: get result of set attribute - check
1129 object_info:
1130 identity: '{{ sub_object.object_guid }}'
1131 properties:
1132 - ansible-BoolSingle
1133 - ansible-BoolMulti
1134 - ansible-BytesSingle
1135 - ansible-BytesMulti
1136 - ansible-DateTimeSingle
1137 - ansible-DateTimeMulti
1138 - ansible-IntSingle
1139 - ansible-IntMulti
1140 - ansible-SDSingle
1141 - ansible-SDMulti
1142 - ansible-StringSingle
1143 - ansible-StringMulti
1144 register: set_attr_check_actual
1145
1146 - name: assert set attribute - check
1147 assert:
1148 that:
1149 - set_attr_check is changed
1150 - set_attr_check_actual.objects[0]['ansible-BoolSingle'] == False
1151 - set_attr_check_actual.objects[0]['ansible-BoolMulti'] == [True]
1152 - set_attr_check_actual.objects[0]['ansible-BytesSingle'] == "Zm9v"
1153 - set_attr_check_actual.objects[0]['ansible-BytesMulti'] | length == 2
1154 - "'YmFy' in set_attr_check_actual.objects[0]['ansible-BytesMulti']"
1155 - "'Zm9v' in set_attr_check_actual.objects[0]['ansible-BytesMulti']"
1156 - set_attr_check_actual.objects[0]['ansible-DateTimeSingle'] == "1970-01-01T00:00:00.0000000Z"
1157 - set_attr_check_actual.objects[0]['ansible-DateTimeMulti'] | length == 2
1158 - "'1601-01-01T01:00:00.0000000Z' in set_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
1159 - "'1969-12-31T23:00:00.0000000Z' in set_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
1160 - set_attr_check_actual.objects[0]['ansible-IntSingle'] == 0
1161 - set_attr_check_actual.objects[0]['ansible-IntMulti'] | length == 2
1162 - 0 in set_attr_check_actual.objects[0]['ansible-IntMulti']
1163 - 1 in set_attr_check_actual.objects[0]['ansible-IntMulti']
1164 - set_attr_check_actual.objects[0]['ansible-SDSingle'] == "O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)"
1165 - set_attr_check_actual.objects[0]['ansible-SDMulti'] | length == 2
1166 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in set_attr_check_actual.objects[0]['ansible-SDMulti']"
1167 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)' in set_attr_check_actual.objects[0]['ansible-SDMulti']"
1168 - set_attr_check_actual.objects[0]['ansible-StringSingle'] == "single"
1169 - set_attr_check_actual.objects[0]['ansible-StringMulti'] | length == 2
1170 - "'multi 1' in set_attr_check_actual.objects[0]['ansible-StringMulti']"
1171 - "'multi 2' in set_attr_check_actual.objects[0]['ansible-StringMulti']"
1172
1173 - name: set attribute
1174 object:
1175 name: Contact
1176 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1177 type: contact
1178 attributes:
1179 set:
1180 ansible-BoolSingle: true
1181 ansible-BoolMulti: false
1182 ansible-BytesSingle:
1183 type: bytes
1184 value: YmFy
1185 ansible-BytesMulti:
1186 - type: bytes
1187 value: dGVzdA==
1188 - type: bytes
1189 value: YmFy
1190 ansible-DateTimeSingle:
1191 type: date_time
1192 value: '1601-01-01T00:00:00Z'
1193 ansible-DateTimeMulti:
1194 - type: date_time
1195 value: '1970-01-01T00:00:00'
1196 - type: date_time
1197 value: '1601-01-01T00:01:00.0-02:00'
1198 ansible-IntSingle: 1
1199 ansible-IntMulti:
1200 - 0
1201 - 3
1202 ansible-SDSingle:
1203 type: security_descriptor
1204 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)
1205 ansible-SDMulti:
1206 - type: security_descriptor
1207 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
1208 - type: security_descriptor
1209 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)
1210 ansible-StringSingle: Single
1211 ansible-StringMulti:
1212 - multi 1
1213 - multi 3
1214 state: present
1215 register: set_attr
1216
1217 - name: get result of set attribute
1218 object_info:
1219 identity: '{{ sub_object.object_guid }}'
1220 properties:
1221 - ansible-BoolSingle
1222 - ansible-BoolMulti
1223 - ansible-BytesSingle
1224 - ansible-BytesMulti
1225 - ansible-DateTimeSingle
1226 - ansible-DateTimeMulti
1227 - ansible-IntSingle
1228 - ansible-IntMulti
1229 - ansible-SDSingle
1230 - ansible-SDMulti
1231 - ansible-StringSingle
1232 - ansible-StringMulti
1233 register: set_attr_actual
1234
1235 - name: assert set attribute
1236 assert:
1237 that:
1238 - set_attr is changed
1239 - set_attr_actual.objects[0]['ansible-BoolSingle'] == True
1240 - set_attr_actual.objects[0]['ansible-BoolMulti'] == [False]
1241 - set_attr_actual.objects[0]['ansible-BytesSingle'] == "YmFy"
1242 - set_attr_actual.objects[0]['ansible-BytesMulti'] | length == 2
1243 - "'YmFy' in set_attr_actual.objects[0]['ansible-BytesMulti']"
1244 - "'dGVzdA==' in set_attr_actual.objects[0]['ansible-BytesMulti']"
1245 - set_attr_actual.objects[0]['ansible-DateTimeSingle'] == "1601-01-01T00:00:00.0000000Z"
1246 - set_attr_actual.objects[0]['ansible-DateTimeMulti'] | length == 2
1247 - "'1601-01-01T02:01:00.0000000Z' in set_attr_actual.objects[0]['ansible-DateTimeMulti']"
1248 - "'1970-01-01T00:00:00.0000000Z' in set_attr_actual.objects[0]['ansible-DateTimeMulti']"
1249 - set_attr_actual.objects[0]['ansible-IntSingle'] == 1
1250 - set_attr_actual.objects[0]['ansible-IntMulti'] | length == 2
1251 - 0 in set_attr_actual.objects[0]['ansible-IntMulti']
1252 - 3 in set_attr_actual.objects[0]['ansible-IntMulti']
1253 - set_attr_actual.objects[0]['ansible-SDSingle'] == "O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)"
1254 - set_attr_actual.objects[0]['ansible-SDMulti'] | length == 2
1255 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in set_attr_actual.objects[0]['ansible-SDMulti']"
1256 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)' in set_attr_actual.objects[0]['ansible-SDMulti']"
1257 - set_attr_actual.objects[0]['ansible-StringSingle'] == "Single"
1258 - set_attr_actual.objects[0]['ansible-StringMulti'] | length == 2
1259 - "'multi 1' in set_attr_actual.objects[0]['ansible-StringMulti']"
1260 - "'multi 3' in set_attr_actual.objects[0]['ansible-StringMulti']"
1261
1262 - name: set attribute - idempotent
1263 object:
1264 name: Contact
1265 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1266 type: contact
1267 attributes:
1268 set:
1269 ansible-BoolSingle: true
1270 ansible-BoolMulti: false
1271 ansible-BytesSingle:
1272 type: bytes
1273 value: YmFy
1274 ansible-BytesMulti:
1275 - type: bytes
1276 value: dGVzdA==
1277 - type: bytes
1278 value: YmFy
1279 ansible-DateTimeSingle:
1280 type: date_time
1281 value: '1601-01-01T00:00:00Z'
1282 ansible-DateTimeMulti:
1283 - type: date_time
1284 value: '1970-01-01T00:00:00'
1285 - type: date_time
1286 value: '1601-01-01T00:01:00.0-02:00'
1287 ansible-IntSingle: 1
1288 ansible-IntMulti:
1289 - 0
1290 - 3
1291 ansible-SDSingle:
1292 type: security_descriptor
1293 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)
1294 ansible-SDMulti:
1295 - type: security_descriptor
1296 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)
1297 - type: security_descriptor
1298 value: O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)
1299 ansible-StringSingle: Single
1300 ansible-StringMulti:
1301 - multi 1
1302 - multi 3
1303 state: present
1304 register: set_attr_again
1305
1306 - name: assert set attribute - idempotent
1307 assert:
1308 that:
1309 - not set_attr_again is changed
1310
1311 - name: clear attribute - check
1312 object:
1313 name: Contact
1314 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1315 type: contact
1316 attributes:
1317 set:
1318 ansible-BoolSingle:
1319 ansible-BoolMulti:
1320 ansible-BytesSingle: []
1321 ansible-BytesMulti: []
1322 ansible-DateTimeSingle: ~
1323 ansible-DateTimeMulti: ~
1324 ansible-IntSingle:
1325 ansible-IntMulti:
1326 ansible-SDSingle:
1327 ansible-SDMulti:
1328 ansible-StringSingle:
1329 ansible-StringMulti:
1330 state: present
1331 register: clear_attr_check
1332 check_mode: true
1333
1334 - name: get result of clear attribute - check
1335 object_info:
1336 identity: '{{ sub_object.object_guid }}'
1337 properties:
1338 - ansible-BoolSingle
1339 - ansible-BoolMulti
1340 - ansible-BytesSingle
1341 - ansible-BytesMulti
1342 - ansible-DateTimeSingle
1343 - ansible-DateTimeMulti
1344 - ansible-IntSingle
1345 - ansible-IntMulti
1346 - ansible-SDSingle
1347 - ansible-SDMulti
1348 - ansible-StringSingle
1349 - ansible-StringMulti
1350 register: clear_attr_check_actual
1351
1352 - name: assert clear attribute - check
1353 assert:
1354 that:
1355 - clear_attr_check is changed
1356 - clear_attr_check_actual.objects[0]['ansible-BoolSingle'] == True
1357 - clear_attr_check_actual.objects[0]['ansible-BoolMulti'] == [False]
1358 - clear_attr_check_actual.objects[0]['ansible-BytesSingle'] == "YmFy"
1359 - clear_attr_check_actual.objects[0]['ansible-BytesMulti'] | length == 2
1360 - "'YmFy' in clear_attr_check_actual.objects[0]['ansible-BytesMulti']"
1361 - "'dGVzdA==' in clear_attr_check_actual.objects[0]['ansible-BytesMulti']"
1362 - clear_attr_check_actual.objects[0]['ansible-DateTimeSingle'] == "1601-01-01T00:00:00.0000000Z"
1363 - clear_attr_check_actual.objects[0]['ansible-DateTimeMulti'] | length == 2
1364 - "'1601-01-01T02:01:00.0000000Z' in clear_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
1365 - "'1970-01-01T00:00:00.0000000Z' in clear_attr_check_actual.objects[0]['ansible-DateTimeMulti']"
1366 - clear_attr_check_actual.objects[0]['ansible-IntSingle'] == 1
1367 - clear_attr_check_actual.objects[0]['ansible-IntMulti'] | length == 2
1368 - 0 in clear_attr_check_actual.objects[0]['ansible-IntMulti']
1369 - 3 in clear_attr_check_actual.objects[0]['ansible-IntMulti']
1370 - clear_attr_check_actual.objects[0]['ansible-SDSingle'] == "O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AN)"
1371 - clear_attr_check_actual.objects[0]['ansible-SDMulti'] | length == 2
1372 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;AU)' in clear_attr_check_actual.objects[0]['ansible-SDMulti']"
1373 - "'O:DAG:DAD:PAI(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;DC)' in clear_attr_check_actual.objects[0]['ansible-SDMulti']"
1374 - clear_attr_check_actual.objects[0]['ansible-StringSingle'] == "Single"
1375 - clear_attr_check_actual.objects[0]['ansible-StringMulti'] | length == 2
1376 - "'multi 1' in clear_attr_check_actual.objects[0]['ansible-StringMulti']"
1377 - "'multi 3' in clear_attr_check_actual.objects[0]['ansible-StringMulti']"
1378
1379 - name: clear attribute
1380 object:
1381 name: Contact
1382 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1383 type: contact
1384 attributes:
1385 set:
1386 ansible-BoolSingle:
1387 ansible-BoolMulti:
1388 ansible-BytesSingle: []
1389 ansible-BytesMulti: []
1390 ansible-DateTimeSingle: ~
1391 ansible-DateTimeMulti: ~
1392 ansible-IntSingle:
1393 ansible-IntMulti:
1394 ansible-SDSingle:
1395 ansible-SDMulti:
1396 ansible-StringSingle:
1397 ansible-StringMulti:
1398 state: present
1399 register: clear_attr
1400
1401 - name: get result of clear attribute
1402 object_info:
1403 identity: '{{ sub_object.object_guid }}'
1404 properties:
1405 - ansible-BoolSingle
1406 - ansible-BoolMulti
1407 - ansible-BytesSingle
1408 - ansible-BytesMulti
1409 - ansible-DateTimeSingle
1410 - ansible-DateTimeMulti
1411 - ansible-IntSingle
1412 - ansible-IntMulti
1413 - ansible-SDSingle
1414 - ansible-SDMulti
1415 - ansible-StringSingle
1416 - ansible-StringMulti
1417 register: clear_attr_actual
1418
1419 - name: assert clear attribute
1420 assert:
1421 that:
1422 - clear_attr is changed
1423 - clear_attr_actual.objects[0]['ansible-BoolSingle'] == None
1424 - clear_attr_actual.objects[0]['ansible-BoolMulti'] == None
1425 - clear_attr_actual.objects[0]['ansible-BytesSingle'] == None
1426 - clear_attr_actual.objects[0]['ansible-BytesMulti'] == None
1427 - clear_attr_actual.objects[0]['ansible-DateTimeSingle'] == None
1428 - clear_attr_actual.objects[0]['ansible-DateTimeMulti'] == None
1429 - clear_attr_actual.objects[0]['ansible-IntSingle'] == None
1430 - clear_attr_actual.objects[0]['ansible-IntMulti'] == None
1431 - clear_attr_actual.objects[0]['ansible-SDSingle'] == None
1432 - clear_attr_actual.objects[0]['ansible-SDMulti'] == None
1433 - clear_attr_actual.objects[0]['ansible-StringSingle'] == None
1434 - clear_attr_actual.objects[0]['ansible-StringMulti'] == None
1435
1436 - name: clear attribute - idempotent
1437 object:
1438 name: Contact
1439 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1440 type: contact
1441 attributes:
1442 set:
1443 ansible-BoolSingle:
1444 ansible-BoolMulti:
1445 ansible-BytesSingle: []
1446 ansible-BytesMulti: []
1447 ansible-DateTimeSingle: ~
1448 ansible-DateTimeMulti: ~
1449 ansible-IntSingle:
1450 ansible-IntMulti:
1451 ansible-SDSingle:
1452 ansible-SDMulti:
1453 ansible-StringSingle:
1454 ansible-StringMulti:
1455 state: present
1456 register: clear_attr_again
1457
1458 - name: assert clear attribute - idempotent
1459 assert:
1460 that:
1461 - not clear_attr_again is changed
1462
1463 - name: unset display and description
1464 object:
1465 name: Contact
1466 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1467 type: contact
1468 display_name: ''
1469 description: ''
1470 register: unset_normal
1471
1472 - name: get result of unset display and description
1473 object_info:
1474 identity: '{{ sub_object.object_guid }}'
1475 properties:
1476 - DisplayName
1477 - Description
1478 register: unset_normal_actual
1479
1480 - name: assert unset display and description
1481 assert:
1482 that:
1483 - unset_normal is changed
1484 - unset_normal_actual.objects[0].DisplayName == None
1485 - unset_normal_actual.objects[0].Description == None
1486
1487 - name: unset display and description - idempotent
1488 object:
1489 name: Contact
1490 path: CN=My\, Container,CN=Users,{{ setup_domain_info.output[0].defaultNamingContext }}
1491 type: contact
1492 display_name: ''
1493 description: ''
1494 register: unset_normal_again
1495
1496 - name: assert unset display and description - idempotent
1497 assert:
1498 that:
1499 - not unset_normal_again is changed
1500
1501 - name: move object back into the default path - check
1502 object:
1503 name: My, Container
1504 identity: '{{ object_identity }}'
1505 type: container
1506 path: microsoft.ad.default_path
1507 register: move_into_default_check
1508 check_mode: true
1509
1510 - name: get result of move object back into the default path - check
1511 object_info:
1512 identity: '{{ object_identity }}'
1513 register: move_into_default_check_actual
1514
1515 - name: assert move object back into the default path - check
1516 assert:
1517 that:
1518 - move_into_default_check is changed
1519 - move_into_default_check.distinguished_name == 'CN=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
1520 - move_into_default_check_actual.objects[0].DistinguishedName == 'CN=My\, Container,CN=Users,' ~ setup_domain_info.output[0].defaultNamingContext
1521
1522 - name: move object back into the default path
1523 object:
1524 name: My, Container
1525 identity: '{{ object_identity }}'
1526 type: container
1527 path: microsoft.ad.default_path
1528 register: move_into_default
1529
1530 - name: get result of move object back into the default path
1531 object_info:
1532 identity: '{{ object_identity }}'
1533 register: move_into_default_actual
1534
1535 - name: assert move object back into the default path
1536 assert:
1537 that:
1538 - move_into_default is changed
1539 - move_into_default.distinguished_name == 'CN=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
1540 - move_into_default_actual.objects[0].DistinguishedName == 'CN=My\, Container,' ~ setup_domain_info.output[0].defaultNamingContext
1541
1542 - name: move object back into the default path - idempotent
1543 object:
1544 name: My, Container
1545 identity: '{{ object_identity }}'
1546 type: container
1547 path: microsoft.ad.default_path
1548 register: move_into_default_again
1549
1550 - name: assert move object back into the default path - idempotent
1551 assert:
1552 that:
1553 - not move_into_default_again is changed