Skip to content

Commit

Permalink
polish openshift-master role
Browse files Browse the repository at this point in the history
  • Loading branch information
ingvagabund committed Jul 31, 2017
1 parent 3be2748 commit 1e870f3
Show file tree
Hide file tree
Showing 5 changed files with 307 additions and 158 deletions.
34 changes: 26 additions & 8 deletions roles/openshift_master/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
---
- 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))
systemd:
name: "{{ openshift.common.service_type }}-master"
state: restarted
when:
- openshift.master.ha is not defined or not openshift.master.ha | bool
- not (master_service_status_changed | default(false) | bool)
notify: Verify API Server

- name: restart master api
systemd: 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'
systemd:
name: "{{ openshift.common.service_type }}-master-api"
state: restarted
when:
- openshift.master.ha is defined and openshift.master.ha | bool
- not (master_api_service_status_changed | default(false) | bool)
- openshift.master.cluster_method == 'native'
notify: Verify API Server

- name: restart master controllers
systemd: 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'
systemd:
name: "{{ openshift.common.service_type }}-master-controllers"
state: restarted
when:
- openshift.master.ha is defined and openshift.master.ha | bool
- not (master_controllers_service_status_changed | default(false) | bool)
- openshift.master.cluster_method == 'native'

- name: Verify API Server
# Using curl here since the uri module requires python-httplib2 and
Expand All @@ -28,8 +42,12 @@
# Disables the following warning:
# Consider using get_url or uri module rather than running curl
warn: no
register: api_available_output
until: api_available_output.stdout == 'ok'
register: l_api_available_output
until:
- l_api_available_output.stdout == 'ok'
retries: 120
delay: 1
changed_when: false

- name: reload systemd units
command: systemctl daemon-reload
Loading

0 comments on commit 1e870f3

Please sign in to comment.