Files
windows-ansible/ansible/roles/win_study/tasks/delete.yml
T
2024-08-05 11:39:36 +01:00

24 lines
753 B
YAML

---
- name: Delete Study
block:
- name: Move study folder to archive
ansible.windows.win_powershell:
script: |
Move-Item -Path "{{ study_folder }}" -Destination S:\Archived_Studies
- name: Delete study folders on T drive
ansible.windows.win_file:
path: "T:\\{{ item }}\\{{ study_code }}"
state: absent
with_items: ["Import", "Export"]
- name: Delete AD group
community.windows.win_domain_group:
name: "{{ study_code }}"
description: "{{ study_code }} study"
path: "ou=Project Groups,dc={{ win_project }},dc=loc"
scope: domainlocal
category: security
state: absent
delegate_to: "{{ os_project }}-{{ win_project }}-dc01"