patching DC
This commit is contained in:
23
patch-dc-controllers.yaml
Normal file
23
patch-dc-controllers.yaml
Normal file
@@ -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'
|
||||||
Reference in New Issue
Block a user