From d74d10d7cfa657b4e4bd74e3e40251de226c377b Mon Sep 17 00:00:00 2001
From: Andrew Butcher <abutcher@redhat.com>
Date: Thu, 21 Jul 2016 10:56:22 -0400
Subject: Default nodes matching selectors when not collected.

---
 roles/openshift_hosted/tasks/registry/registry.yml | 2 +-
 roles/openshift_hosted/tasks/router/router.yml     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'roles/openshift_hosted/tasks')

diff --git a/roles/openshift_hosted/tasks/registry/registry.yml b/roles/openshift_hosted/tasks/registry/registry.yml
index a242ce30f..a1edef132 100644
--- a/roles/openshift_hosted/tasks/registry/registry.yml
+++ b/roles/openshift_hosted/tasks/registry/registry.yml
@@ -9,7 +9,7 @@
   when: openshift.hosted.registry.replicas | default(none) is none
 
 - set_fact:
-    replicas: "{{ openshift.hosted.registry.replicas | default(((openshift_hosted_registry_nodes_json.stdout | from_json)['items'] | length) if openshift.hosted.registry.storage.kind | default(none) is not none else 1) }}"
+    replicas: "{{ openshift.hosted.registry.replicas | default(((openshift_hosted_registry_nodes_json.stdout | default('{\"items\":[]}') | from_json)['items'] | length) if openshift.hosted.registry.storage.kind | default(none) is not none else 1) }}"
 
 - name: Create OpenShift registry
   command: >
diff --git a/roles/openshift_hosted/tasks/router/router.yml b/roles/openshift_hosted/tasks/router/router.yml
index dfea8ca4b..7f3731c7d 100644
--- a/roles/openshift_hosted/tasks/router/router.yml
+++ b/roles/openshift_hosted/tasks/router/router.yml
@@ -44,7 +44,7 @@
   when: openshift.hosted.router.replicas | default(none) is none
 
 - set_fact:
-    replicas: "{{ openshift.hosted.router.replicas | default((openshift_hosted_router_nodes_json.stdout | from_json)['items'] | length) }}"
+    replicas: "{{ openshift.hosted.router.replicas | default((openshift_hosted_router_nodes_json.stdout | default('{\"items\":[]}') | from_json)['items'] | length) }}"
 
 - name: Create OpenShift router
   command: >
-- 
cgit v1.2.3