blob: cf20df65b8f7f295b56988e8022e2cad52570043 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
- name: Upgrade packages
hosts: all
gather_facts: false
tasks:
- name: Update and upgrade
apt:
update_cache: true
upgrade: safe
register: result
- name: Dump debug result
debug:
var: result
- name: Check if reboot required
stat:
path: /var/run/reboot-required
register: reboot_required_file
- name: Reboot if required
reboot:
when: reboot_required_file.stat.exists == true
|