From eec2f317cb4ea707f4e528bd7bb6f4e643fb865d Mon Sep 17 00:00:00 2001
From: Andrew Butcher <abutcher@redhat.com>
Date: Tue, 18 Jul 2017 14:31:26 -0400
Subject: Fail within scaleup playbooks when new_{nodes,masters} host groups
 are empty.

---
 playbooks/byo/openshift-node/scaleup.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'playbooks/byo/openshift-node')

diff --git a/playbooks/byo/openshift-node/scaleup.yml b/playbooks/byo/openshift-node/scaleup.yml
index c6965fd6f..fda89b1ea 100644
--- a/playbooks/byo/openshift-node/scaleup.yml
+++ b/playbooks/byo/openshift-node/scaleup.yml
@@ -1,6 +1,19 @@
 ---
 - include: ../openshift-cluster/initialize_groups.yml
 
+- name: Ensure there are new_nodes
+  hosts: localhost
+  connection: local
+  become: no
+  gather_facts: no
+  tasks:
+  - fail:
+      msg: >
+        Detected no new_nodes in inventory. Please add hosts to the
+        new_nodes host group to add nodes.
+    when:
+    - g_new_node_hosts | default([]) | length == 0
+
 - include: ../../common/openshift-node/scaleup.yml
   vars:
     openshift_cluster_id: "{{ cluster_id | default('default') }}"
-- 
cgit v1.2.3