ansible で対象サーバを再起動する方法を調べてみた。 「Ansibleの事例とちょっとしたTips」を参考に、というか答え丸写しなのだが、いろいろなテクニックが使われている。 プレイブック作成 reboot.os.yml を作成する。 --- - hosts: '{{ hosts }}' tasks: - name: test connection (before reboot) ping: - name: reboot! command: shutdown -r now - name: wait for SSH port down local_action: wait_for host={{ inventory_hostname }} port=22 state=stopped - name: wait for SSH port up wait_for: host={{ inven