---
- hosts: env_{{ env_id }}:&controller
  tasks:
    - name: Restart controllers
      shell: sleep 2 && shutdown -r now "Ansible updates triggered"
      async: 1
      poll: 0
      ignore_errors: true

    - name: Waiting for server to come back
      local_action: wait_for host={{ inventory_hostname }} port=22 state=drained delay=300 timeout=600

    - name: Stop CEPH Monitors
      service: name=ceph-mon-all state=stopped
      when:
        - "'ceph-osd' in groups"

- hosts: env_{{ env_id }}:!controller
  tasks:
    - name: Restart other hosts in environment
      shell: sleep 2 && shutdown -r now "Ansible updates triggered"
      async: 1
      poll: 0
      ignore_errors: true

    - name: Waiting for server to come back
      local_action: wait_for host={{ inventory_hostname }} port=22 state=drained delay=300 timeout=600

- hosts: env_{{ env_id }}:&ceph-osd
  tasks:
    - name: Waiting for all OSDs up
      script: files/wait_all_ceph_osd_up.sh

- hosts: env_{{ env_id }}:&controller
  tasks:
    - name: Start CEPH Monitors
      service: name=ceph-mon-all state=started
      when:
        - "'ceph-osd' in groups"

---
- hosts: env_{{ env_id }}:&controller
  tasks:
    - name: Restart controllers
      shell: sleep 2 && shutdown -r now "Ansible updates triggered"
      async: 1
      poll: 0
      ignore_errors: true

    - name: Waiting for server to come back
      local_action: wait_for host={{ inventory_hostname }} port=22 state=drained delay=300 timeout=1000

    - name: Stop CEPH Monitors
      service: name=ceph-mon-all state=stopped
      when:
        - "'ceph-osd' in groups"

- hosts: env_{{ env_id }}:!controller
  tasks:
    - name: Restart other hosts in environment
      shell: sleep 2 && shutdown -r now "Ansible updates triggered"
      async: 1
      poll: 0
      ignore_errors: true

    - name: Waiting for server to come back
      local_action: wait_for host={{ inventory_hostname }} port=22 state=drained delay=300 timeout=1000

- hosts: env_{{ env_id }}:&ceph-osd
  tasks:
    - name: Waiting for all OSDs up
      script: files/wait_all_ceph_osd_up.sh

- hosts: env_{{ env_id }}:&controller
  tasks:
    - name: Start CEPH Monitors
      service: name=ceph-mon-all state=started
      when:
        - "'ceph-osd' in groups"

Increase timeout for restart servers
Increase timeout for restart servers
