Browse Source

Updating openshift_hosted_logging to update master-configs with publicLoggingURL

ewolinetz 8 years ago
parent
commit
d5c8f481b6

+ 11 - 0
playbooks/adhoc/openshift_hosted_logging_efk.yaml

@@ -3,3 +3,14 @@
   roles:
   - role: openshift_hosted_logging
     openshift_hosted_logging_cleanup: no
+
+- name: Update master-config for publicLoggingURL
+  hosts: masters:!masters[0]
+  pre_tasks:
+    - set_fact:
+        logging_hostname: "{{ openshift_hosted_logging_hostname | default('kibana.' ~ (openshift_master_default_subdomain | default('router.default.svc.cluster.local', true))) }}"
+  tasks:
+    - include_role:
+        name: openshift_hosted_logging
+        tasks_from: update_master_config
+      when: openshift_hosted_logging_deploy | default(false) | bool

+ 11 - 0
playbooks/common/openshift-cluster/openshift_hosted.yml

@@ -45,3 +45,14 @@
 
   - role: cockpit-ui
     when: ( openshift.common.version_gte_3_3_or_1_3  | bool ) and ( openshift_hosted_manage_registry | default(true) | bool ) and not (openshift.docker.hosted_registry_insecure | default(false) | bool)
+
+- name: Update master-config for publicLoggingURL
+  hosts: masters:!oo_first_master
+  pre_tasks:
+    - set_fact:
+        logging_hostname: "{{ openshift_hosted_logging_hostname | default('kibana.' ~ (openshift_master_default_subdomain | default('router.default.svc.cluster.local', true))) }}"
+  tasks:
+    - include_role:
+        name: openshift_hosted_logging
+        tasks_from: update_master_config
+      when: openshift_hosted_logging_deploy | default(false) | boola

+ 1 - 0
playbooks/common/openshift-cluster/openshift_logging.yml

@@ -10,3 +10,4 @@
     - include_role:
         name: openshift_logging
         tasks_from: update_master_config
+      when: openshift_logging_install_logging | default(false) | bool

+ 1 - 6
roles/openshift_hosted_logging/tasks/deploy_logging.yaml

@@ -165,12 +165,7 @@
   retries: 20
   delay: 15
 
-- name: Adding Kibana route information to loggingPublicURL
-  modify_yaml:
-    dest: "{{ openshift.common.config_base }}/master/master-config.yaml"
-    yaml_key: assetConfig.loggingPublicURL
-    yaml_value: "https://{{ openshift_logging_kibana_hostname }}"
-  notify: restart master
+- include: update_master_config.yaml
 
 - debug:
     msg: "Logging components deployed. Note persistent volume for elasticsearch must be setup manually"

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

@@ -0,0 +1,7 @@
+---
+- name: Adding Kibana route information to loggingPublicURL
+  modify_yaml:
+    dest: "{{ openshift.common.config_base }}/master/master-config.yaml"
+    yaml_key: assetConfig.loggingPublicURL
+    yaml_value: "https://{{ logging_hostname }}"
+  notify: restart master