Files
ansible/azure_restore-to-clean-room.yml
2024-07-12 12:58:40 +02:00

32 lines
1.8 KiB
YAML

---
- name: Get resource group info
become: true
# become_user: root
# become_method: runas
hosts: all
tasks:
- name: Copy VHD from WORM sa to corporate sa
ansible.windows.win_command: powershell.exe -
args:
stdin: |
C:\Windows\System32\azcopy_windows_amd64_10.16.2\azcopy.exe copy --recursive
"https://saapewormsaweprd.blob.core.windows.net/coapewormsaweprd0/?sv=2021-06-08&ss=bfqt&srt=co&sp=rwdlacupiytfx&se=2023-01-31T21:01:05Z&st=2022-11-30T13:01:05Z&spr=https&sig=7HCiPgsEF7LPik0QxPfoDysKNsInZyyk%2BQiKGkgNxfM%3D"
"https://sacleanroomstaging.blob.core.windows.net/vhds/?sv=2021-12-02&ss=bfqt&srt=co&sp=rwdlacupiytfx&se=2024-04-25T16:39:57Z&st=2023-04-25T08:39:57Z&spr=https&sig=o3huUH3%2F0xBXu0FBPuhvKacitPWrLRf7oLYGY9SqYLc%3D"
--include-pattern 'OG_{{ host }}*{{ day }}-{{ month }}-{{ year }}.vhd'
register: output
# async: 1200
# poll: 120
when: sa == 'coapewormsaweprd0'
- name: Copy VHD from WORM sa to corporate sa
ansible.windows.win_command: powershell.exe -
args:
stdin: C:\Windows\System32\azcopy_windows_amd64_10.16.2\azcopy.exe copy --recursive "https://saapewormlaweprd1.blob.core.windows.net/coapewormlaweprd1-0?sp=rl&st=2023-05-25T11:09:20Z&se=2024-05-25T19:09:20Z&spr=https&sv=2022-11-02&sr=c&sig=p4wInyNdaS3dkmuMyqZEB%2BkrHYtT1diM0eEgqE%2FmqY4%3D" "https://sacleanroomstaging.blob.core.windows.net/vhds/?sv=2021-12-02&ss=bfqt&srt=co&sp=rwdlacupiytfx&se=2024-04-25T16:39:57Z&st=2023-04-25T08:39:57Z&spr=https&sig=o3huUH3%2F0xBXu0FBPuhvKacitPWrLRf7oLYGY9SqYLc%3D" --include-pattern 'OG_{{ host }}*{{ day }}-{{ month }}-{{ year }}.vhd'
register: output
# async: 1200
# poll: 120
when: sa == 'saapewormlaweprd1'
- name: Debug output
ansible.builtin.debug:
var: output.stdout