2
This commit is contained in:
@@ -1,20 +1,20 @@
|
|||||||
---
|
---
|
||||||
- name: Patch Domain Controllers via SYSTEM task
|
- name: Patch Domain Controllers via SYSTEM task
|
||||||
hosts: DCServers
|
hosts: domain_controllers
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Start the SYSTEM patch task
|
- name: Start the SYSTEM patch task
|
||||||
ansible.windows.win_scheduled_task:
|
community.windows.win_scheduled_task:
|
||||||
name: "Patching-windows-task"
|
name: "Patching-windows-task"
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Wait for task to finish
|
- name: Wait for task to finish
|
||||||
ansible.windows.win_scheduled_task_stat:
|
community.windows.win_scheduled_task_stat:
|
||||||
name: "Patching-windows-task"
|
name: "Patching-windows-task"
|
||||||
register: taskstat
|
register: taskstat
|
||||||
until: taskstat.task.state in ['Ready','Disabled']
|
until: taskstat.task.state in ['Ready','Disabled']
|
||||||
retries: 180 # 3 hours
|
retries: 180
|
||||||
delay: 60
|
delay: 60
|
||||||
|
|
||||||
- name: Reboot if required
|
- name: Reboot if required
|
||||||
|
|||||||
Reference in New Issue
Block a user