mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 22:07:21 +00:00
32 lines
1.0 KiB
YAML
32 lines
1.0 KiB
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: Removing folders
|
|
block:
|
|
- name: Delete study folders on T drive
|
|
ansible.windows.win_file:
|
|
path: "T:\\{{ item }}\\{{ study_code }}"
|
|
state: absent
|
|
with_items: ["Import", "Export"]
|
|
|
|
- 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"
|