Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.7] Add restart single master handler for etcdv3 upgrade from embedded etcd #7801

Merged
merged 3 commits into from
Apr 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions roles/openshift_master/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
when:
- not (master_api_service_status_changed | default(false) | bool)
- openshift.master.cluster_method == 'native'
- master_api_enabled is defined and (master_api_enabled.rc == 0 or openshift_version | version_compare('3.7','>='))
notify:
- Verify API Server

Expand All @@ -19,6 +20,18 @@
when:
- not (master_controllers_service_status_changed | default(false) | bool)
- openshift.master.cluster_method == 'native'
- master_controllers_enabled is defined and (master_controllers_enabled.rc == 0 or openshift_version | version_compare('3.7','>='))

# For now, this handler is called only from update_etcd_client_urls.yml in case migration from previous version.
# Thus, {{ *_service_status_changed }} like api, controllers is neither implemented nor handled.
- name: restart single master
systemd:
name: "{{ openshift.common.service_type }}-master"
state: restarted
when:
- single_master_enabled is defined and (single_master_enabled.rc == 0 or openshift_version | version_compare('3.7','<'))
notify:
- Verify API Server

- name: Verify API Server
# Using curl here since the uri module requires python-httplib2 and
Expand Down
2 changes: 2 additions & 0 deletions roles/openshift_master/tasks/update_etcd_client_urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
notify:
- restart master api
- restart master controllers
# We need this notify for etcd migration.
- restart single master
18 changes: 18 additions & 0 deletions roles/openshift_master_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,24 @@
openshift_master_scheduler_default_predicates: "{{ lookup('openshift_master_facts_default_predicates') }}"
openshift_master_scheduler_default_priorities: "{{ lookup('openshift_master_facts_default_priorities') }}"

- name: Determine if master api service is enabled
command: >
systemctl -q is-enabled {{ openshift.common.service_type }}-master-api
register: master_api_enabled
failed_when: false

- name: Determine if master controllers service is enabled
command: >
systemctl -q is-enabled {{ openshift.common.service_type }}-master-controllers
register: master_controllers_enabled
failed_when: false

- name: Determine if single master service is enabled
command: >
systemctl -q is-enabled {{ openshift.common.service_type }}-master
register: single_master_enabled
failed_when: false

- block:
- name: Retrieve current scheduler config
slurp:
Expand Down