2015-01-23 17:17:17 +00:00
|
|
|
- name: unattended-upgrade
|
|
|
|
# by default, run only just
|
|
|
|
hosts: '{{target | default("just")}}'
|
2015-01-28 01:08:15 +00:00
|
|
|
sudo: yes
|
2015-01-23 17:17:17 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
2015-01-28 01:08:15 +00:00
|
|
|
- name: update apt-get
|
|
|
|
apt: update_cache=yes
|
|
|
|
|
2015-01-23 17:17:17 +00:00
|
|
|
- name: apply upgrade
|
|
|
|
command: sudo unattended-upgrade
|
|
|
|
|
|
|
|
- name: check whether reboot needed
|
|
|
|
stat: path=/var/run/reboot-required
|
|
|
|
register: reboot_required
|
|
|
|
|
|
|
|
- debug: var=reboot_required.stat.exists
|
|
|
|
|