How to do a simple reboot with ansible and resume the playbook ?
May be you know, I do some tutorials in devops world.
Recently I start a playlist about ansible, a great tool for the infrastructure as code. This is an beginners playlist to learn step by step to understand and use it.
In a new video, I explain how to use the reboot module, a very simple but powerfull module. With it, you can reboot a server. But ansible can restart the server and check it after the reboot and resume the playbook to do the rest of tasks.
This is very useful, for example, to do a dist upgrade or kernel upgrade who need a reboot after.
For example, you can do it like this :
- name: update cache
- name: dist upgrade
- name: check the reboot-required file
- name: launch the reboot
msg: "Reboot with ansible..."