mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 21:47:21 +00:00
34 lines
924 B
YAML
34 lines
924 B
YAML
---
|
|
- name: Update all choco packages
|
|
tags: update_choco
|
|
block:
|
|
- name: Run Chocolatey upgrade (allow failure, don't mark as failed)
|
|
win_shell: |
|
|
choco upgrade all -y --ignore-checksums --failonunfound --continue-on-failure
|
|
register: choco_result
|
|
ignore_errors: true
|
|
|
|
- name: Show Chocolatey output
|
|
debug:
|
|
var: choco_result
|
|
|
|
- name: Update Start Menu Shortcuts in XML on remote Windows machines
|
|
tags: update_start_menu
|
|
block:
|
|
- name: Copy current XML to backup location
|
|
win_copy:
|
|
remote_src: true
|
|
src: "{{ start_menu_xml }}"
|
|
dest: "{{ backup_xml }}"
|
|
force: true
|
|
|
|
- name: Run Python script on remote machine
|
|
win_command: python {{ script_path }}
|
|
|
|
rescue:
|
|
- name: Restore backup XML
|
|
win_copy:
|
|
remote_src: true
|
|
src: "{{ backup_xml }}"
|
|
dest: "{{ start_menu_xml }}"
|
|
force: true |