From c68c9d95fca6485c79a607b3716a88e284c7a64e Mon Sep 17 00:00:00 2001
From: Sam Yaple <sam@yaple.net>
Date: Mon, 7 Sep 2015 12:04:28 +0000
Subject: [PATCH] Gather facts from the hosts before using them

Haproxy needs to have gathered facts from all hosts that it will use
information about. In this case it must talk to all of the api hosts
as well as the database and rabbitmq hosts before generating the
configuration file.

Change-Id: I99b7dbebd5a6193e192ee258ddf576d18db90ed7
Closes-Bug: #1482406
---
 ansible/roles/haproxy/tasks/main.yml | 2 ++
 ansible/site.yml                     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ansible/roles/haproxy/tasks/main.yml b/ansible/roles/haproxy/tasks/main.yml
index 1f16915ad9..ab9215b168 100755
--- a/ansible/roles/haproxy/tasks/main.yml
+++ b/ansible/roles/haproxy/tasks/main.yml
@@ -1,4 +1,6 @@
 ---
 - include: config.yml
+  when: inventory_hostname in groups['haproxy']
 
 - include: start.yml
+  when: inventory_hostname in groups['haproxy']
diff --git a/ansible/site.yml b/ansible/site.yml
index 6eeafed366..b2aa134c92 100755
--- a/ansible/site.yml
+++ b/ansible/site.yml
@@ -1,5 +1,5 @@
 ---
-- hosts: haproxy
+- hosts: [haproxy, mariadb, rabbitmq, cinder-api, glance-api, keystone, nova-api, neutron-server, swift-proxy-server]
   roles:
     - { role: haproxy, tags: haproxy, keepalived, when: enable_haproxy | bool }
 
-- 
GitLab