Automated weekly system reboot using Ansible
A scheduled and planned system reboot is a standard process in an IT environment to ensure the servers and applications are working well and the environment is stable with service restart operations. The reboot
command might be simple when it executes but the reboot process and its formalities are not straightforward.
A generic server reboot activity involves multiple steps, as shown in the following diagram:
Figure 3.42 – Typical system reboot job workflow
Imagine that you have hundreds of servers to reboot every week and your team is too small to handle such critical operations on weekends. It is possible to automate the entire workflow using Ansible by using backup operations before reboot and service verifications after reboot.
The Ansible reboot
module was introduced in Ansible 2.7 (2018). At the time of writing, this module is part of ansible-core
and included in all Ansible installations.