Interview Prep/Ansible/Rolling Updates, Delegation and Safe Deployments

How does the `reboot` module work and what options matter?

IntermediateProductionRolling Updates, Delegation and Safe Deployments
Answer

It issues a reboot command, waits for the host to go down, then waits until it is reachable again and a test command succeeds. This avoids hand-built shutdown plus wait_for_connection logic.

- ansible.builtin.reboot:
    reboot_timeout: 1200
    pre_reboot_delay: 5
    post_reboot_delay: 30
    test_command: systemctl is-system-running --wait
    msg: "Reboot by Ansible patch run"

reboot_timeout should cover slow bare-metal firmware or large instances. The module needs become and, for Windows hosts, the ansible.windows.win_reboot equivalent. Add a post_reboot_delay if services start slowly after the connection comes back.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Safe Deployments