forked from mjhermanson/lightbulb-patching
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindows_patching.yml
34 lines (33 loc) · 878 Bytes
/
windows_patching.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: Patch Windows server(s)
gather_facts: "no"
vars_files:
- vars/winrm.yml
hosts:
# - "{{ windows_patch_hosts }}"
- windows
tasks:
# Check if there are missing updates
- block:
- name: Check for missing updates.
win_updates:
state: searched
register: update_count
#Install missing updates only if at least one is missing
- block:
- name: Install missing updates.
win_updates:
category_names:
- Application
- Connectors
- DefinitionUpdates
- DeveloperKits
- FeaturePacks
- Guidance
- ServicePacks
- Tools
- UpdateRollups
- CriticalUpdates
- SecurityUpdates
reboot: yes
register: update_result