wait_for
Collection: builtin
Full Name: parallax.builtin.wait_for
Aliases: ansible.builtin.wait_for, wait_for
Synopsis
Wait for a port, path or pattern to reach a given state
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| host | string | 127.0.0.1 | A resolvable hostname or IP address to wait for | |
| port | int | Port number to check | ||
| path | string | Path to a file on the filesystem that must exist before continuing | ||
| search_regex | string | Regular expression to search for in the file or in the data read from the socket. Multiline by default | ||
| state | string | started | Either present, started, stopped, absent, or drained | |
| timeout | int | 300 | Maximum number of seconds to wait, counted from before the delay | |
| delay | int | 0 | Number of seconds to wait before starting to poll | |
| sleep | int | 1 | Number of seconds to sleep between checks | |
| connect_timeout | int | 5 | Maximum number of seconds to wait for a connection to happen before closing and retrying | |
| exclude_hosts | list | List of hosts or IPs to ignore when looking for active TCP connections for state=drained | ||
| active_connection_states | list | [ESTABLISHED FIN_WAIT1 FIN_WAIT2 SYN_RECV SYN_SENT CLOSE_WAIT] | The list of TCP connection states which are counted as active for state=drained | |
| msg | string | Message to report instead of the default one when the condition is not met in time |
Example
- name: Wait for the database port to accept connections
wait_for:
host: db1.internal
port: 5432
state: started
timeout: 300