From 9ed378a12afae4f30550ca91b21392077d094f53 Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Fri, 27 Jan 2017 14:39:38 -0600 Subject: Updating openshift_logging role to add kibana public url to loggingPublicURL in master-config --- roles/openshift_logging/tasks/install_logging.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml index a9699adb8..f0bc709df 100644 --- a/roles/openshift_logging/tasks/install_logging.yaml +++ b/roles/openshift_logging/tasks/install_logging.yaml @@ -44,6 +44,13 @@ loop_var: file when: not ansible_check_mode +- 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 + - name: Printing out objects to create debug: msg={{file.content | b64decode }} with_items: "{{ object_defs.results }}" -- cgit v1.2.3 From d9bebc99fe94c2a981e6b96f36d0292d7fa80879 Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Fri, 27 Jan 2017 15:34:01 -0600 Subject: Updating to correctly pull handler for openshift_logging. Adding logic to openshift_hosted_logging too --- roles/openshift_hosted_logging/handlers/main.yml | 5 +++++ roles/openshift_hosted_logging/meta/main.yaml | 1 + roles/openshift_hosted_logging/tasks/deploy_logging.yaml | 7 +++++++ roles/openshift_logging/handlers/main.yml | 5 +++++ roles/openshift_logging/meta/main.yaml | 1 + 5 files changed, 19 insertions(+) create mode 100644 roles/openshift_hosted_logging/handlers/main.yml create mode 100644 roles/openshift_logging/handlers/main.yml diff --git a/roles/openshift_hosted_logging/handlers/main.yml b/roles/openshift_hosted_logging/handlers/main.yml new file mode 100644 index 000000000..ad79e62ae --- /dev/null +++ b/roles/openshift_hosted_logging/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart master + systemd: name={{ openshift.common.service_type }}-master state=restarted + when: (openshift.master.ha is not defined or not openshift.master.ha | bool) and (not (master_service_status_changed | default(false) | bool)) + notify: Verify API Server diff --git a/roles/openshift_hosted_logging/meta/main.yaml b/roles/openshift_hosted_logging/meta/main.yaml index b695bde87..044c8043c 100644 --- a/roles/openshift_hosted_logging/meta/main.yaml +++ b/roles/openshift_hosted_logging/meta/main.yaml @@ -1,3 +1,4 @@ --- dependencies: - { role: openshift_common } + - { role: openshift_master_facts } diff --git a/roles/openshift_hosted_logging/tasks/deploy_logging.yaml b/roles/openshift_hosted_logging/tasks/deploy_logging.yaml index 513a74c69..c7f055b31 100644 --- a/roles/openshift_hosted_logging/tasks/deploy_logging.yaml +++ b/roles/openshift_hosted_logging/tasks/deploy_logging.yaml @@ -165,6 +165,13 @@ 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 + - debug: msg: "Logging components deployed. Note persistent volume for elasticsearch must be setup manually" diff --git a/roles/openshift_logging/handlers/main.yml b/roles/openshift_logging/handlers/main.yml new file mode 100644 index 000000000..ad79e62ae --- /dev/null +++ b/roles/openshift_logging/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart master + systemd: name={{ openshift.common.service_type }}-master state=restarted + when: (openshift.master.ha is not defined or not openshift.master.ha | bool) and (not (master_service_status_changed | default(false) | bool)) + notify: Verify API Server diff --git a/roles/openshift_logging/meta/main.yaml b/roles/openshift_logging/meta/main.yaml index 9c480f73a..bc45dcdab 100644 --- a/roles/openshift_logging/meta/main.yaml +++ b/roles/openshift_logging/meta/main.yaml @@ -14,3 +14,4 @@ galaxy_info: dependencies: - role: lib_openshift - role: openshift_facts +- role: openshift_master_facts -- cgit v1.2.3 From d44fe7d0120e1851399b20809aad9b7c17a6add9 Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Fri, 27 Jan 2017 16:54:41 -0600 Subject: ensuring ruamel.yaml is on target for oc_scale --- roles/openshift_logging/tasks/main.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/openshift_logging/tasks/main.yaml b/roles/openshift_logging/tasks/main.yaml index 4c718805e..36fb827c3 100644 --- a/roles/openshift_logging/tasks/main.yaml +++ b/roles/openshift_logging/tasks/main.yaml @@ -12,6 +12,10 @@ - debug: msg="Created temp dir {{mktemp.stdout}}" +- name: Ensuring ruamel.yaml package is on target + command: yum install -y ruamel.yaml + check_mode: no + - name: Copy the admin client config(s) command: > cp {{ openshift_master_config_dir }}/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig -- cgit v1.2.3 From c9afeb9e86ff5389d68e2fe25b9e6baaf56b72c6 Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Mon, 30 Jan 2017 10:59:45 -0600 Subject: Breaking out master-config changing and updated playbook to apply change to other masters --- playbooks/common/openshift-cluster/openshift_logging.yml | 7 +++++++ roles/openshift_logging/tasks/install_logging.yaml | 7 +------ roles/openshift_logging/tasks/update_master_config.yaml | 7 +++++++ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 roles/openshift_logging/tasks/update_master_config.yaml diff --git a/playbooks/common/openshift-cluster/openshift_logging.yml b/playbooks/common/openshift-cluster/openshift_logging.yml index 6347cbc26..3257018a0 100644 --- a/playbooks/common/openshift-cluster/openshift_logging.yml +++ b/playbooks/common/openshift-cluster/openshift_logging.yml @@ -3,3 +3,10 @@ hosts: oo_first_master roles: - openshift_logging + +- name: Update Master configs + hosts: masters:!oo_first_master + tasks: + - include_role: + name: openshift_logging + tasks_from: update_master_config diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml index f0bc709df..32007e8f2 100644 --- a/roles/openshift_logging/tasks/install_logging.yaml +++ b/roles/openshift_logging/tasks/install_logging.yaml @@ -44,12 +44,7 @@ loop_var: file when: not ansible_check_mode -- 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 - name: Printing out objects to create debug: msg={{file.content | b64decode }} diff --git a/roles/openshift_logging/tasks/update_master_config.yaml b/roles/openshift_logging/tasks/update_master_config.yaml new file mode 100644 index 000000000..af303c47c --- /dev/null +++ b/roles/openshift_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://{{ openshift_logging_kibana_hostname }}" + notify: restart master -- cgit v1.2.3 From d5c8f481b6a1a23f95fa2c7c621cbbf2edf64b7a Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Mon, 30 Jan 2017 12:50:57 -0600 Subject: Updating openshift_hosted_logging to update master-configs with publicLoggingURL --- playbooks/adhoc/openshift_hosted_logging_efk.yaml | 11 +++++++++++ playbooks/common/openshift-cluster/openshift_hosted.yml | 11 +++++++++++ playbooks/common/openshift-cluster/openshift_logging.yml | 1 + roles/openshift_hosted_logging/tasks/deploy_logging.yaml | 7 +------ .../openshift_hosted_logging/tasks/update_master_config.yaml | 7 +++++++ 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 roles/openshift_hosted_logging/tasks/update_master_config.yaml diff --git a/playbooks/adhoc/openshift_hosted_logging_efk.yaml b/playbooks/adhoc/openshift_hosted_logging_efk.yaml index def1d24e0..c08231dda 100644 --- a/playbooks/adhoc/openshift_hosted_logging_efk.yaml +++ b/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 diff --git a/playbooks/common/openshift-cluster/openshift_hosted.yml b/playbooks/common/openshift-cluster/openshift_hosted.yml index ec5b18389..a5b26c7de 100644 --- a/playbooks/common/openshift-cluster/openshift_hosted.yml +++ b/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 diff --git a/playbooks/common/openshift-cluster/openshift_logging.yml b/playbooks/common/openshift-cluster/openshift_logging.yml index 3257018a0..580d1e5a7 100644 --- a/playbooks/common/openshift-cluster/openshift_logging.yml +++ b/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 diff --git a/roles/openshift_hosted_logging/tasks/deploy_logging.yaml b/roles/openshift_hosted_logging/tasks/deploy_logging.yaml index c7f055b31..afd82766f 100644 --- a/roles/openshift_hosted_logging/tasks/deploy_logging.yaml +++ b/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" diff --git a/roles/openshift_hosted_logging/tasks/update_master_config.yaml b/roles/openshift_hosted_logging/tasks/update_master_config.yaml new file mode 100644 index 000000000..1122e059c --- /dev/null +++ b/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 -- cgit v1.2.3