Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
modzilla99 authored Dec 22, 2021
1 parent fd893c9 commit 4c1242b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@
hosts: all
gather_facts: false
tasks:
- name: Running Windows Update
win_updates:
category_names: ['SecurityUpdates','CriticalUpdates','UpdateRollups', 'Updates', 'DefinitionUpdates']
#category_names: ['SecurityUpdates']
register: result
- name: Update Installation
until: win_update.found_update_count == 0
retries: 3
delay: 10
block:
- name: Running Windows Update
ignore_errors: true
win_updates:
category_names: ['SecurityUpdates','CriticalUpdates','UpdateRollups', 'Updates', 'DefinitionUpdates']
#category_names: ['SecurityUpdates']
register: win_update

# output results
- debug: var=result
# output results
- debug: var=win_update

# reboot only if required
- win_reboot:
when: result.reboot_required
# reboot only if required
- win_reboot:
when: win_update.reboot_required

0 comments on commit 4c1242b

Please sign in to comment.