ansible.builtin.reboot – Reboot a machine
This module is part of
ansible-core and included in all Ansible
installations. In most cases, you can use the short
reboot even without specifying the
However, we recommend you use the FQCN for easy linking to the
module documentation and to avoid conflicting with other collections that may have
the same module name.
New in version 2.7: of ansible.builtin
Reboot a machine, wait for it to go down, come back up, and respond to commands.
For Windows targets, use the ansible.windows.win_reboot module instead.
This module has a corresponding action plugin.
Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller
Supports being used with the
Forces a ‘global’ task that does not execute per host, this bypasses per host templating and serial, throttle and other loop considerations
Conditionals will work as if
run_onceis being used, variables used will be from the first available host
This action will not work normally outside of lockstep strategies
Can run in check_mode and return changed status prediction withought modifying target
Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode
Target OS/families that can be operated against
PATHis ignored on the remote node when searching for the
search_pathsto specify locations to search if the default paths do not work.
The official documentation on the ansible.windows.win_reboot module.
- name: Unconditionally reboot the machine with all defaults reboot: - name: Reboot a slow machine that might have lots of updates to apply reboot: reboot_timeout: 3600 - name: Reboot a machine with shutdown command in unusual place reboot: search_paths: - '/lib/molly-guard' - name: Reboot machine using a custom reboot command reboot: reboot_command: launchctl reboot userspace boot_time_command: uptime | cut -d ' ' -f 5
Common return values are documented here, the following are the fields unique to this module:
The number of seconds that elapsed waiting for the system to be rebooted.
true if the machine was rebooted