From 9293059f5d331e26fc86c9fc841e2a57fcba8ae6 Mon Sep 17 00:00:00 2001
From: Andrew Butcher <abutcher@redhat.com>
Date: Fri, 7 Oct 2016 16:58:36 -0400
Subject: Move infrastructure templates into openshift_hosted_templates role.

---
 roles/openshift_hosted_logging/defaults/main.yml         |  2 +-
 roles/openshift_hosted_logging/tasks/deploy_logging.yaml | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

(limited to 'roles/openshift_hosted_logging')

diff --git a/roles/openshift_hosted_logging/defaults/main.yml b/roles/openshift_hosted_logging/defaults/main.yml
index e357899e5..a01f24df8 100644
--- a/roles/openshift_hosted_logging/defaults/main.yml
+++ b/roles/openshift_hosted_logging/defaults/main.yml
@@ -1,2 +1,2 @@
 ---
-examples_base: "{{ openshift.common.config_base if openshift.common.is_containerized | bool else '/usr/share/openshift' }}/examples"
+hosted_base: "{{ openshift.common.config_base if openshift.common.is_containerized | bool else '/usr/share/openshift' }}/hosted"
diff --git a/roles/openshift_hosted_logging/tasks/deploy_logging.yaml b/roles/openshift_hosted_logging/tasks/deploy_logging.yaml
index c8d376194..0162d1fb0 100644
--- a/roles/openshift_hosted_logging/tasks/deploy_logging.yaml
+++ b/roles/openshift_hosted_logging/tasks/deploy_logging.yaml
@@ -17,7 +17,7 @@
       cp {{ openshift_master_config_dir }}/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
     changed_when: False
 
-  - name: Check for logging project already exists
+  - name: "Check for logging project already exists"
     command: >
       {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get project logging -o jsonpath='{.metadata.name}'
     register: logging_project_result
@@ -40,9 +40,13 @@
 
   - name: "Create templates for logging accounts and the deployer"
     command: >
-      {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig create -f {{ examples_base }}/infrastructure-templates/{{ 'enterprise' if openshift_deployment_type == 'openshift-enterprise' else 'origin' }}/logging-deployer.yaml
-    register: template_output
-    failed_when: "template_output.rc == 1 and 'exists' not in template_output.stderr"
+      {{ openshift.common.client_binary }} create
+      -f {{ hosted_base }}/logging-deployer.yaml
+      --config={{ mktemp.stdout }}/admin.kubeconfig
+      -n logging
+    register: logging_import_template
+    failed_when: "'already exists' not in logging_import_template.stderr and logging_import_template.rc != 0"
+    changed_when: "'created' in logging_import_template.stdout"
 
   - name: "Process the logging accounts template"
     shell:  "{{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig process logging-deployer-account-template |  {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig create -f -"
-- 
cgit v1.2.3