mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-29 05:57:21 +00:00
Remove users that fail during creation to prevent assert step failing on reruns
This commit is contained in:
1 parent
d5a45cd531
commit
56f19b86fe
1 file changed
+12
-2
@@ -11,7 +11,7 @@
|
|||||||
groups:
|
groups:
|
||||||
add:
|
add:
|
||||||
- "{{ study_code }}"
|
- "{{ study_code }}"
|
||||||
- Remote Desktop Users
|
- "{{ guacamole_user_group }}"
|
||||||
email: "{{ email }}"
|
email: "{{ email }}"
|
||||||
attributes:
|
attributes:
|
||||||
add:
|
add:
|
||||||
@@ -20,4 +20,14 @@
|
|||||||
password_expired: true
|
password_expired: true
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- import_tasks: exporter.yml # referece exporter so modify can be more general purpose
|
- import_tasks: exporter.yml # referece exporter so modify can be more general purpose
|
||||||
|
|
||||||
|
rescue:
|
||||||
|
- name: Removing failed User
|
||||||
|
microsoft.ad.user:
|
||||||
|
name: "{{ username }}"
|
||||||
|
path: ou=Project Users,dc={{ win_project }},dc=loc
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Trigger Failure
|
||||||
|
ansible.builtin.fail:
|
||||||
Reference in new issue
Block a user