From 8f97076381760f5e47b01ab8c2e681ea62e8e278 Mon Sep 17 00:00:00 2001 From: "mhorak@totalservice.cz" Date: Mon, 18 Aug 2025 13:15:44 +0200 Subject: [PATCH] patching DC --- patch-dc-controllers.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patch-dc-controllers.yaml diff --git a/patch-dc-controllers.yaml b/patch-dc-controllers.yaml new file mode 100644 index 0000000..728abb8 --- /dev/null +++ b/patch-dc-controllers.yaml @@ -0,0 +1,23 @@ +--- +- name: Patch Domain Controllers via SYSTEM task + hosts: domain_controllers + gather_facts: no + + tasks: + - name: Start the SYSTEM patch task + ansible.windows.win_scheduled_task: + name: "Patching-windows-task" + state: started + + - name: Wait for task to finish + ansible.windows.win_scheduled_task_stat: + name: "Patching-windows-task" + register: taskstat + until: taskstat.task.state in ['Ready','Disabled'] + retries: 180 # 3 hours + delay: 60 + + - name: Reboot if required + ansible.windows.win_reboot: + reboot_timeout: 3600 + when: taskstat.task.state == 'Ready'