ANSIBLE.WAIT_FOR(3)

NAME
wait_for - Waits for a condition before continuing.

DESCRIPTION

Waiting for a port to become available is useful for when services are not immediately available after their init scripts return - which is true of certain Java application servers. It is also useful when starting guests with the virt module and needing to pause until they are ready. This module can also be used to wait for a file to be available on the filesystem or with a regex match a string to be present in a file.

OPTIONS

delay
    number of seconds to wait before starting to poll

host
    hostname or IP address to wait for (default: 127.0.0.1)

path
    path to a file on the filesytem that must exist before continuing(Added in Ansible version 1.4.)

port
    port number to poll

search_regex
    with the path option can be used match a string in the file that must match before continuing. Defaults to a multiline regex.(Added in Ansible version 1.4.)

state
    either present, started, or stoppedWhen checking a port started will ensure the port is open, stopped will check that it is closedWhen checking for a file or a search string present or started will ensure that the file or string is present before continuing Choices: present,started,stopped. (default: started)

timeout
    maximum number of seconds to wait for (default: 300).

EXAMPLES
# wait 300 seconds for port 8000 to become open on the host, don't start checking for 10 seconds
- wait_for: port=8000 delay=10"
# wait until the file /tmp/foo is present before continuing
- wait_for: path=/tmp/foo
# wait until the string "completed" is in the file /tmp/foo before continuing
- wait_for: path=/tmp/foo search_regex=completed

AUTHOR
Jeroen Hoekx, John Jarvis

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#wait-for