reboot

Collection: builtin

Full Name: parallax.builtin.reboot

Aliases: ansible.builtin.reboot, reboot

Synopsis

Reboot the target and wait for it to come back

Parameters

NameTypeRequiredDefaultDescription
pre_reboot_delayint0Seconds to wait before reboot
post_reboot_delayint0Seconds to wait after the reboot command was successful
reboot_timeoutint600Maximum seconds to wait for machine to reboot and respond to a test command
connect_timeoutint5Maximum seconds to wait for a successful connection to the managed hosts before trying again
test_commandstringwhoamiCommand to run on the rebooted host and expect success from to determine the machine is ready for further tasks
msgstringReboot initiated by AnsibleMessage to display to users before reboot
search_pathslist[/sbin /usr/sbin /usr/local/sbin /bin /usr/bin /usr/local/bin]Paths to search on the remote machine for the shutdown command
boot_time_commandstringcat /proc/sys/kernel/random/boot_idCommand to run that returns a unique string indicating the last time the system was booted
reboot_commandstringshutdown -r nowCommand to run to reboot the machine

Example

- name: Reboot after a kernel upgrade
  reboot:
    msg: Rebooting for a kernel upgrade
    reboot_timeout: 900
    post_reboot_delay: 15