Remove users that fail during creation to prevent assert step failing on reruns

This commit is contained in:
abrown38 committed 2024-12-18 15:37:14 +00:00
1 parent d5a45cd531
commit 56f19b86fe
1 file changed
+12 -2
+12 -2
View File
@@ -11,7 +11,7 @@
groups:
add:
- "{{ study_code }}"
- Remote Desktop Users
- "{{ guacamole_user_group }}"
email: "{{ email }}"
attributes:
add:
@@ -20,4 +20,14 @@
password_expired: true
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: