Skip to content

Instantly share code, notes, and snippets.

@elnur
Last active April 26, 2021 13:31
Show Gist options
  • Save elnur/3d166a4e6867f2a1a831 to your computer and use it in GitHub Desktop.
Save elnur/3d166a4e6867f2a1a831 to your computer and use it in GitHub Desktop.
Rebooting Servers One-by-One With Ansible http://elnur.pro/rebooting-servers-one-by-one-with-ansible/
- hosts: all
serial: 1
tasks:
- name: Reboot
command: /sbin/reboot removes=/var/run/reboot-required
- name: Wait for the server to reboot
local_action: wait_for host={{ inventory_hostname }} port=22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment