Files
AWX/patch-dc-controllers.yaml
2025-09-08 15:45:31 +02:00

18 lines
452 B
YAML

---
- name: Patch Windows DCs using PowerShell via JEA
hosts: windows
gather_facts: no
tasks:
- name: Search for updates
win_shell: Get-WindowsUpdate
register: search_output
- name: Install updates
win_shell: Install-WindowsUpdate -AcceptAll -AutoReboot
register: install_output
- name: Reboot the system
win_shell: Restart-Computer -Force
when: install_output.stdout | search("RebootRequired")