html
The role will check if a host requires a reboot - this is usually indicated by the presence of the /var/run/reboot-required
file. If it's found, the role will perform a reboot and will wait for the host to come back. Otherwise, nothing will happen.
The reboot can be forced using the reboot__force
boolean variable, either via inventory or using the --extra-vars
ansible-playbook
parameter, for example:
debops run reboot -l <host> -e 'reboot__force=true'
If the display_skipped_hosts
option is set to False
in the ansible.cfg
configuration file, the task which performs the reboot will not show up in the ansible-playbook
output immediately, which might appear as Ansible "hanging" while waiting for the host to come back. This is an expected behaviour.
The playbook will work only on hosts that are in the main DebOps host group in the Ansible inventory:
[debops_all_hosts]
hostname1
hostname2
If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.reboot
role:
../../../../ansible/playbooks/reboot.yml