ansible/ansible — pull request #934 by jhoekx (2012-08-23 17:48:46+00:00)
Title: Add the wait_for module.

This module waits until a specific port on a given host can be connected to.

Very useful in deployments/testing.

Parameters:
- name: name of the host to connect to
- port: port number to connect to
- timeout: number of seconds to wait before giving up (default 300)

Example usage:

```
---

- hosts: rear
user: root
gather_facts: false

vars:
rear: /tmp/rear-checkout

tasks:
- name: ensure guest is running
action: virt guest=${inventory_hostname} state=running
delegate_to: fireflash

- name: Wait for ${inventory_hostname}
action: wait_for name=${inventory_hostname}
delegate_to: fireflash

- name: install rear git
action: git repo=https://github.com/rear/rear.git dest=$rear

- name: configure rear
action: copy src=../config/etc/rear/local.conf dest=${rear}/etc/rear/local.conf

- name: run rear
action: command ${rear}/usr/sbin/rear mkbackup
```