Help us understand the problem. What is going on with this article?

Ansibleでサーバ一括再起動

More than 5 years have passed since last update.

Ansibleでサーバ一括起動し、SSHログインできるまで待つ

---
# reboot.yml

- name: reboot all hosts and wait it come back in port 22
  hosts: all
  remote_user: ec2-user
  sudo: yes


  tasks:
    - name: hostname
      command: uname -n
      register: hostname
    - debug: msg="{{hostname.stdout_lines}}"

    - name: Restart server
      command: shutdown -r now "Reboot triggered by Ansible"
      async: 0
      poll: 0
      ignore_errors: true
      notify: Wait for server to restart

  handlers:
    - name: Wait for server to restart
      local_action:
        module: wait_for
          host={{ inventory_hostname }}
          port=22
          delay=1
          timeout=300
        #sudo: false

wanghm
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした