From 46901fdba788a52743823c74bd14a82ea90f4339 Mon Sep 17 00:00:00 2001
From: Tomas Sedovic <tomas@sedovic.cz>
Date: Thu, 29 Jun 2017 14:22:53 +0000
Subject: Use wait_for_connection for the Heat nodes

The `wait_for_connection` module is more reliable as it uses Ansible's `ping`
to verify the nodes are really accessible. Using `wait_for` and checking that
port 22 is open runs into the possibility of SSH being up but the public keys
or users not being set up yet (as that's done with cloud-init).

In addition, we were gathering facts before running the wait_for task which
rendered it useless.
---
 playbooks/provisioning/openstack/provision-openstack.yml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/playbooks/provisioning/openstack/provision-openstack.yml b/playbooks/provisioning/openstack/provision-openstack.yml
index feea15d5d..18989f448 100644
--- a/playbooks/provisioning/openstack/provision-openstack.yml
+++ b/playbooks/provisioning/openstack/provision-openstack.yml
@@ -38,6 +38,13 @@
   tasks:
   - meta: refresh_inventory
 
+- hosts: cluster_hosts
+  name: Wait for the the nodes to come up
+  become: False
+  gather_facts: False
+  tasks:
+    - wait_for_connection:
+
 - hosts: cluster_hosts
   gather_facts: True
   tasks:
@@ -45,8 +52,5 @@
     debug:
       msg: "{{ hostvars[inventory_hostname] }}"
       verbosity: 2
-  - name: waiting for server to come back
-    local_action: wait_for host={{ hostvars[inventory_hostname]['ansible_ssh_host'] }} port=22 delay=30 timeout=300
-    become: false
 
 - include: post-provision-openstack.yml
-- 
cgit v1.2.3


From d705cb2586680f3e747ef2917bd4640504629acf Mon Sep 17 00:00:00 2001
From: Tomas Sedovic <tomas@sedovic.cz>
Date: Thu, 29 Jun 2017 16:54:04 +0200
Subject: Fix yaml indentation

---
 playbooks/provisioning/openstack/provision-openstack.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/playbooks/provisioning/openstack/provision-openstack.yml b/playbooks/provisioning/openstack/provision-openstack.yml
index 18989f448..5d521432b 100644
--- a/playbooks/provisioning/openstack/provision-openstack.yml
+++ b/playbooks/provisioning/openstack/provision-openstack.yml
@@ -43,7 +43,7 @@
   become: False
   gather_facts: False
   tasks:
-    - wait_for_connection:
+  - wait_for_connection:
 
 - hosts: cluster_hosts
   gather_facts: True
-- 
cgit v1.2.3