mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-27 08:27:21 +00:00
initial config
This commit is contained in:
1 parent
cf22af1a4f
commit
c679ff2f09
4 files changed
+751
No files matched your search
@@ -0,0 +1,47 @@
|
||||
---
|
||||
- name: Install scoop
|
||||
tags: install_scoop
|
||||
block:
|
||||
#- name: download install script
|
||||
# ansible.windows.win_powershell:
|
||||
# script: |
|
||||
# irm get.scoop.sh -outfile 'C:\eidf\install.ps1'
|
||||
- name: Run install script
|
||||
win_shell: |
|
||||
powershell Invoke-RestMethod -Uri https://get.scoop.sh -outfile 'C:\eidf\install.ps1'
|
||||
powershell -File "C:\eidf\install.ps1" -RunAsAdmin
|
||||
register: scoop_install
|
||||
rescue:
|
||||
- name: Check if Scoop is already installed
|
||||
debug:
|
||||
msg: "Scoop is already installed, continuing..."
|
||||
when: scoop_install.stdout is search("Scoop is already installed")
|
||||
|
||||
- name: Fail if other error occurred
|
||||
fail:
|
||||
msg: "Scoop installation failed with unexpected error."
|
||||
when: scoop_install.stdout is not search("Scoop is already installed")
|
||||
when: inventory_hostname in groups['meta-name_fs01']
|
||||
|
||||
- name: setup backups
|
||||
tags: setup_backups
|
||||
block:
|
||||
- name: Install restic
|
||||
win_shell: scoop install restic
|
||||
tags: install_restic
|
||||
|
||||
- name: Install resticprofile
|
||||
win_shell: scoop install resticprofile
|
||||
tags: install_resticprofile
|
||||
|
||||
- name: Copy resticprofile
|
||||
ansible.windows.win_template:
|
||||
src: "profiles.yaml"
|
||||
dest: "C:\\resticprofile"
|
||||
force: true
|
||||
tags: copy_resticprofile
|
||||
|
||||
- name: Schedule resticprofile
|
||||
win_shell: resticprofile -n study_data schedule
|
||||
tags: schedule_resticprofile
|
||||
when: inventory_hostname in groups['meta-name_fs01']
|
||||
Reference in new issue
Block a user