Browse Source

do not create logging project if it already exists

Rich Megginson 8 years ago
parent
commit
d66f7edf5a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      roles/openshift_hosted_logging/tasks/deploy_logging.yaml

+ 7 - 0
roles/openshift_hosted_logging/tasks/deploy_logging.yaml

@@ -14,9 +14,16 @@
       cp {{ openshift_master_config_dir }}/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
     changed_when: False
 
+  - 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
+    ignore_errors: True
+
   - name: "Create logging project"
     command: >
       {{ openshift.common.admin_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig new-project logging
+    when: logging_project_result.stdout == ""
 
   - name: "Changing projects"
     command: >