# rebooting host

**URL:** <https://forum.ansible.com/t/rebooting-host/20582>\
**Category:** Ansible Project\
**Tags:** rhel, fedora\
**Created:** [February 15, 2016, 2:21pm UTC](https://forum.ansible.com/t/rebooting-host/20582 "2016-02-15T14:21:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yfried](https://avatars.discourse-cdn.com/v4/letter/y/4da419/32.png) [@yfried](https://forum.ansible.com/u/yfried)\
**Post date:** [February 15, 2016, 2:21pm UTC](https://forum.ansible.com/t/rebooting-host/20582/1 "2016-02-15T14:21:46Z")

</div>

Hi,  
I am following [https://support.ansible.com/hc/en-us/articles/201958037-Reboot-a-server-and-wait-for-it-to-come-back](https://support.ansible.com/hc/en-us/articles/201958037-Reboot-a-server-and-wait-for-it-to-come-back) trying to use ansible to reboot hosts.  
My problem is that the wait\_for always reaches the full timeout+delay (without failure). why is that?

Any help would be appreciated.  
Regards

Ansible 1.9.4  
Tested on Fedora 23 and RHEL 7

role:

`

```auto
---
- name: restart machine
  shell: sleep 2 && shutdown -r now "Ansible updates triggered"
  async: 1
  poll: 0
  sudo: true
  ignore_errors: true

- name: waiting for server to come back
  delegate_to: localhost
  sudo: no
  wait_for:
      host: "{{ host }}"
      state: started
      delay: "{{ boot_delay }}"
      timeout: "{{ boot_timeout }}"

- name: wait for ssh
  delegate_to: localhost
  sudo: no
  wait_for:
      host: "{{ host }}"
      port: "{{ ssh_port }}"
      search_regex: OpenSSH
      timeout: "{{ ssh_timeout }}"

```

`

log:

---

<div class="post-metadata">

**Author:** ![Paul\_Markham](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@Paul\_Markham](https://forum.ansible.com/u/Paul_Markham)\
**Post date:** [February 15, 2016, 8:39pm UTC](https://forum.ansible.com/t/rebooting-host/20582/2 "2016-02-15T20:39:11Z")

</div>

Try specifying a port on the wait\_for command. According to the documentation, if you don’t specify a port (or path), it just waits for the timeout to expire, which seems to be what you’re seeing. Possible just use the SSH port check as that’s what you really care about.
