summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/handlers
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-08-25 09:33:21 -0400
committerGitHub <noreply@github.com>2016-08-25 09:33:21 -0400
commitd08a872a0392c100e86eed41f5d5372d226538c0 (patch)
tree14286133d094e90882258506cf34d25ada484f37 /roles/openshift_metrics/handlers
parent0af3d7cd96e4584c2d1301d84c1f02234a8cfdb5 (diff)
parent3f2d71a1bfb589778733dd8eb0ccd6b1dac31d79 (diff)
downloadopenshift-d08a872a0392c100e86eed41f5d5372d226538c0.tar.gz
openshift-d08a872a0392c100e86eed41f5d5372d226538c0.tar.bz2
openshift-d08a872a0392c100e86eed41f5d5372d226538c0.tar.xz
openshift-d08a872a0392c100e86eed41f5d5372d226538c0.zip
Merge pull request #2052 from sdodson/metrics
Metrics improvements
Diffstat (limited to 'roles/openshift_metrics/handlers')
-rw-r--r--roles/openshift_metrics/handlers/main.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/openshift_metrics/handlers/main.yml b/roles/openshift_metrics/handlers/main.yml
new file mode 100644
index 000000000..edb7369de
--- /dev/null
+++ b/roles/openshift_metrics/handlers/main.yml
@@ -0,0 +1,31 @@
+---
+- name: restart master
+ service: 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
+
+- name: restart master api
+ service: name={{ openshift.common.service_type }}-master-api state=restarted
+ when: (openshift.master.ha is defined and openshift.master.ha | bool) and (not (master_api_service_status_changed | default(false) | bool)) and openshift.master.cluster_method == 'native'
+ notify: Verify API Server
+
+- name: restart master controllers
+ service: name={{ openshift.common.service_type }}-master-controllers state=restarted
+ when: (openshift.master.ha is defined and openshift.master.ha | bool) and (not (master_controllers_service_status_changed | default(false) | bool)) and openshift.master.cluster_method == 'native'
+
+- name: Verify API Server
+ # Using curl here since the uri module requires python-httplib2 and
+ # wait_for port doesn't provide health information.
+ command: >
+ curl --silent
+ {% if openshift.common.version_gte_3_2_or_1_2 | bool %}
+ --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
+ {% else %}
+ --cacert {{ openshift.common.config_base }}/master/ca.crt
+ {% endif %}
+ {{ openshift.master.api_url }}/healthz/ready
+ register: api_available_output
+ until: api_available_output.stdout == 'ok'
+ retries: 120
+ delay: 1
+ changed_when: false