diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2016-12-01 12:37:20 -0400 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2016-12-01 12:37:20 -0400 |
commit | 7e8e98dad2adde361c7ecc6e7b043429bed6d77a (patch) | |
tree | 9a193f72094d77fae4369ec2a31f714c58e11a9f /roles/openshift_metrics/tasks | |
parent | 4ff3ae5f8e99145a06a0cc9976ec07c008831b65 (diff) | |
download | openshift-7e8e98dad2adde361c7ecc6e7b043429bed6d77a.tar.gz openshift-7e8e98dad2adde361c7ecc6e7b043429bed6d77a.tar.bz2 openshift-7e8e98dad2adde361c7ecc6e7b043429bed6d77a.tar.xz openshift-7e8e98dad2adde361c7ecc6e7b043429bed6d77a.zip |
Fix metricsPublicURL only being set correctly on first master.
Problem was caused by facts not being set for that master. To fix this
patch cleans up the calculation of metricsPublicURL in general. Because
this value is used in openshift_master to template into the master
config file, we now define these facts more clearly in
openshift_master_facts, and add a dependency on this to
openshift_metrics.
The calculation of default sub-domain is also changed to remove it from
system facts (as neither of these are facts about the system) and
instead use plain variables.
Diffstat (limited to 'roles/openshift_metrics/tasks')
-rw-r--r-- | roles/openshift_metrics/tasks/install.yml | 11 | ||||
-rw-r--r-- | roles/openshift_metrics/tasks/main.yaml | 10 |
2 files changed, 2 insertions, 19 deletions
diff --git a/roles/openshift_metrics/tasks/install.yml b/roles/openshift_metrics/tasks/install.yml index 98e21375a..0f520e685 100644 --- a/roles/openshift_metrics/tasks/install.yml +++ b/roles/openshift_metrics/tasks/install.yml @@ -89,7 +89,7 @@ set_fact: deployer_cmd: "{{ openshift.common.client_binary }} process -f \ {{ hosted_base }}/metrics-deployer.yaml -v \ - HAWKULAR_METRICS_HOSTNAME={{ metrics_hostname }} \ + HAWKULAR_METRICS_HOSTNAME={{ g_metrics_hostname }} \ -v USE_PERSISTENT_STORAGE={{metrics_persistence | string | lower }} \ -v DYNAMICALLY_PROVISION_STORAGE={{metrics_dynamic_vol | string | lower }} \ -v METRIC_DURATION={{ openshift.hosted.metrics.duration }} \ @@ -128,12 +128,5 @@ modify_yaml: dest: "{{ openshift.common.config_base }}/master/master-config.yaml" yaml_key: assetConfig.metricsPublicURL - yaml_value: "https://{{ metrics_hostname }}/hawkular/metrics" + yaml_value: "{{ openshift_hosted_metrics_public_url }}" notify: restart master - -- name: Store metrics public_url - openshift_facts: - role: master - local_facts: - metrics_public_url: "https://{{ metrics_hostname }}/hawkular/metrics" - when: deploy_result | changed diff --git a/roles/openshift_metrics/tasks/main.yaml b/roles/openshift_metrics/tasks/main.yaml index 26af279b1..be3256f02 100644 --- a/roles/openshift_metrics/tasks/main.yaml +++ b/roles/openshift_metrics/tasks/main.yaml @@ -1,8 +1,4 @@ --- -- fail: - msg: This role required openshift_master_default_subdomain or openshift_hosted_metrics_public_url be set - when: openshift.master.metrics_public_url | default(openshift_hosted_metrics_public_url | default(openshift.master.default_subdomain | default(openshift_master_default_subdomain | default(none)))) is none - - name: Create temp directory for kubeconfig command: mktemp -d /tmp/openshift-ansible-XXXXXX register: mktemp @@ -27,12 +23,6 @@ - 'openshift.hosted.metrics.*' - set_fact: - # Prefer the master facts over bare variables if present, prefer - # metrics_public_url over creating a default using default_subdomain - metrics_hostname: "{{ openshift.hosted.metrics.public_url - | default('hawkular-metrics.' ~ (openshift.master.default_subdomain - | default(openshift_master_default_subdomain ))) - | oo_hostname_from_url }}" metrics_persistence: "{{ openshift.hosted.metrics.storage_kind | default(none) is not none }}" metrics_dynamic_vol: "{{ openshift.hosted.metrics.storage_kind | default(none) == 'dynamic' }}" metrics_template_dir: "{{ openshift.common.config_base if openshift.common.is_containerized | bool else '/usr/share/openshift' }}/examples/infrastructure-templates/{{ 'origin' if deployment_type == 'origin' else 'enterprise' }}" |