community.openwrt.wait_for_connection module – Waits until an OpenWrt device is reachable/usable

Note

This module is part of the community.openwrt collection (version 1.4.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.openwrt.

To use it in a playbook, specify: community.openwrt.wait_for_connection.

Synopsis

  • Waits for a total of timeout seconds.

  • Retries the transport connection after a timeout of connect_timeout.

  • Tests the transport connection every sleep seconds.

  • Uses community.openwrt.ping to verify end-to-end connectivity without requiring Python on the target.

Note

This module has a corresponding action plugin.

Parameters

Parameter

Comments

connect_timeout

integer

Maximum number of seconds to wait for a connection to happen before closing and retrying.

Default: 5

delay

integer

Number of seconds to wait before starting to poll.

Default: 0

sleep

integer

Number of seconds to sleep between checks.

Default: 1

timeout

integer

Maximum number of seconds to wait for.

Default: 600

Attributes

Attribute

Support

Description

check_mode

Support: none

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Returns details on what has changed (or possibly needs changing in check_mode), when in diff mode.

platform

Platform: OpenWrt

Target platform for this module.

See Also

See also

ansible.builtin.wait_for_connection

The official documentation on the ansible.builtin.wait_for_connection module.

ansible.builtin.wait_for

The official documentation on the ansible.builtin.wait_for module.

community.openwrt.ping

Verify ability to communicate with OpenWrt targets.

Examples

- name: Wait for OpenWrt device to become reachable
  community.openwrt.wait_for_connection:

- name: Wait up to 5 minutes, starting checks after 10 seconds
  community.openwrt.wait_for_connection:
    delay: 10
    timeout: 300

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

elapsed

float

The number of seconds that elapsed waiting for the connection to appear.

Returned: always

Sample: 23.1

Authors

  • Alexei Znamensky (@russoz)