From bce3235761a16fd8048760ce8ee63e0a64d672a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= <lhuard@amadeus.com>
Date: Fri, 19 Aug 2016 14:33:18 +0200
Subject: =?UTF-8?q?Fix=20the=20=E2=80=9Cnode=20on=20master=E2=80=9D=20feat?=
 =?UTF-8?q?ure?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

What we want to do is to add the master as a node if:
* `g_nodeonmaster` is set to true, and
* we are not in the case where we want to add new nodes.

The second test was done by only checking whether `g_new_node_hosts` was defined.
This was wrong because, in all cloud-provider setups, this variable was set
with the default value of “empty list” (`[]`).
The test has been changed to use the `bool` filter so that it correctly evaluates
to false (and hence, effectively add the master as a node) when `g_new_node_hosts`
is the empty list.
---
 playbooks/common/openshift-cluster/evaluate_groups.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'playbooks/common/openshift-cluster')

diff --git a/playbooks/common/openshift-cluster/evaluate_groups.yml b/playbooks/common/openshift-cluster/evaluate_groups.yml
index 3fb42a7fa..b3e02fb97 100644
--- a/playbooks/common/openshift-cluster/evaluate_groups.yml
+++ b/playbooks/common/openshift-cluster/evaluate_groups.yml
@@ -77,7 +77,7 @@
       ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
       ansible_become: "{{ g_sudo | default(omit) }}"
     with_items: "{{ g_master_hosts | default([]) }}"
-    when: g_nodeonmaster | default(false) == true and g_new_node_hosts is not defined
+    when: g_nodeonmaster | default(false) | bool and not g_new_node_hosts | default(false) | bool
 
   - name: Evaluate oo_first_etcd
     add_host:
-- 
cgit v1.2.3