wait for isn't waiting

28 views
Skip to first unread message

Chris Short

unread,
Apr 23, 2015, 3:24:50 PM4/23/15
to ansible...@googlegroups.com
For some reason this wait for is not working:

- name: stop
  shell: /opt/tools/shutdown.sh
    wait_for
      port=8009
      state=stopped
      delay=15
      timeout=300

When running this in a playbook the playbook finishes immediately. I cannot for the life of me figure out why as port 8009 is open for a significant amount of time after the shell is executed.

Yassen Damyanov

unread,
Apr 23, 2015, 3:56:11 PM4/23/15
to ansible...@googlegroups.com
Just a hint: the default host for the "port" version of "wait_for" is 127.0.0.1. If your service is bound to another interface (say, 192.168.5.5), then wait_for will not wait.
Y.

Brian Coca

unread,
Apr 23, 2015, 4:00:15 PM4/23/15
to ansible...@googlegroups.com
wait_for is a task, not a property of shell, it needs it's own task
block, also you might want to make it a 'local action' if that port is
related in any way to how you access that host.



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages