From 929490ff8c06e6d34a6bba5078a2c97a0e20f8c8 Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Wed, 8 Jun 2016 09:45:29 +0000 Subject: [PATCH] Wait for server to be ssh reachable before bootstrap/configuration Change-Id: Id229a8de97f08ebca3aff04aa612cd922a73e9a6 --- site.yml | 1 + wait_for_servers.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 wait_for_servers.yml diff --git a/site.yml b/site.yml index 30bb760..956144d 100644 --- a/site.yml +++ b/site.yml @@ -1,6 +1,7 @@ --- # file: site.yml - include: generate_infra_dynamic_groups.yml +- include: wait_for_servers.yml - include: common.yml - include: set_hostnames.yml - include: bootstrap_puppetmaster.yml diff --git a/wait_for_servers.yml b/wait_for_servers.yml new file mode 100644 index 0000000..dc50857 --- /dev/null +++ b/wait_for_servers.yml @@ -0,0 +1,10 @@ +--- +# file: wait_for_servers.yml +- hosts: localhost + connection: local + gather_facts: no + user: ubuntu + become: true + tasks: + - wait_for: port=22 host="{{ hostvars[item]['ansible_ssh_host'] }}" search_regex=OpenSSH delay=10 + with_items: "{{ groups['infra'] }}"