You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
573 B
30 lines
573 B
#
|
|
# task: update
|
|
#
|
|
|
|
- name: Updates with APT
|
|
apt:
|
|
name: '*'
|
|
state: latest
|
|
update_cache: yes
|
|
only_upgrade: yes
|
|
|
|
#
|
|
# check for reboot
|
|
#
|
|
|
|
- name: Check if a reboot is needed for Debian and Ubuntu boxes
|
|
register: reboot_required_file
|
|
stat:
|
|
path: /var/run/reboot-required
|
|
|
|
- name: Reboot the Debian or Ubuntu server
|
|
reboot:
|
|
msg: "Reboot initiated by Ansible due to kernel updates"
|
|
connect_timeout: 5
|
|
reboot_timeout: 300
|
|
pre_reboot_delay: 0
|
|
post_reboot_delay: 30
|
|
test_command: uptime
|
|
when: reboot_required_file.stat.exists
|