summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-12-08 12:55:41 -0500
committerGitHub <noreply@github.com>2016-12-08 12:55:41 -0500
commit16749761a312894d8ba1101917b7ebf430616812 (patch)
tree1cccc66e87939cb8faccad8ba197d1a54fc2c38e /roles/openshift_metrics
parent09b3183997a65c2835a95cf8c38c28e3f20380a7 (diff)
parent7e8e98dad2adde361c7ecc6e7b043429bed6d77a (diff)
downloadopenshift-16749761a312894d8ba1101917b7ebf430616812.tar.gz
openshift-16749761a312894d8ba1101917b7ebf430616812.tar.bz2
openshift-16749761a312894d8ba1101917b7ebf430616812.tar.xz
openshift-16749761a312894d8ba1101917b7ebf430616812.zip
Merge pull request #2902 from dgoodwin/fix-metrics-url
Fix metricsPublicURL only being set correctly on first master.
Diffstat (limited to 'roles/openshift_metrics')
-rw-r--r--roles/openshift_metrics/README.md8
-rw-r--r--roles/openshift_metrics/meta/main.yaml1
-rw-r--r--roles/openshift_metrics/tasks/install.yml11
-rw-r--r--roles/openshift_metrics/tasks/main.yaml10
4 files changed, 4 insertions, 26 deletions
diff --git a/roles/openshift_metrics/README.md b/roles/openshift_metrics/README.md
index f3c0f3474..015a673a8 100644
--- a/roles/openshift_metrics/README.md
+++ b/roles/openshift_metrics/README.md
@@ -27,17 +27,11 @@ From this role:
| openshift_hosted_metrics_resolution | `10s` | Metrics resolution |
-From openshift_common:
-
-| Name | Default Value | |
-|---------------------------------------|----------------|----------------------------------------|
-| openshift_master_default_subdomain | null | Subdomain FQDN (Mandatory) |
-
-
Dependencies
------------
openshift_facts
openshift_examples
+openshift_master_facts
Example Playbook
----------------
diff --git a/roles/openshift_metrics/meta/main.yaml b/roles/openshift_metrics/meta/main.yaml
index a89467de5..debca3ca6 100644
--- a/roles/openshift_metrics/meta/main.yaml
+++ b/roles/openshift_metrics/meta/main.yaml
@@ -15,3 +15,4 @@ galaxy_info:
dependencies:
- { role: openshift_examples }
- { role: openshift_facts }
+- { role: openshift_master_facts }
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' }}"