21 lines
446 B
YAML
21 lines
446 B
YAML
|
# vim: ft=yaml.ansible
|
||
|
---
|
||
|
- name: Check if a reboot is needed
|
||
|
stat:
|
||
|
path: /var/run/reboot-required
|
||
|
register: needs_reboot
|
||
|
|
||
|
- name: Reboot host
|
||
|
reboot:
|
||
|
connect_timeout: 120
|
||
|
when: needs_reboot.stat.exists or
|
||
|
(force_reboot is defined and force_reboot)
|
||
|
register: reboot
|
||
|
|
||
|
- name: Re-gather facts
|
||
|
setup:
|
||
|
filter:
|
||
|
- ansible_mounts
|
||
|
- ansible_swaptotal_mb
|
||
|
when: reboot.rebooted is defined and reboot.rebooted
|