-
Notifications
You must be signed in to change notification settings - Fork 54
/
update_windows.yml
executable file
·50 lines (40 loc) · 1.13 KB
/
update_windows.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
- name: install Windows Updates
hosts: all
tasks:
- block:
- name: check for missing updates.
win_updates:
state: searched
register: update_count
- debug:
var: update_count
- name: install all windows updates
win_updates:
category_names:
- CriticalUpdates
- DefinitionUpdates
- SecurityUpdates
- UpdateRollups
- Updates
reboot: yes
when: update_count.found_update_count|int >= 1
rescue:
- name: reboot before continue to retry
win_reboot:
- name: install all windows updates (retry)
win_updates:
category_names:
- CriticalUpdates
- DefinitionUpdates
- SecurityUpdates
- UpdateRollups
- Updates
reboot: yes
always:
- name: check for missing updates.
win_updates:
state: searched
register: update_count
- name: list missing updates
debug:
var: update_count