2019-06-09 00:11:06 -04:00
|
|
|
---
|
|
|
|
- name: restart zookeeper
|
|
|
|
service:
|
|
|
|
name: zookeeper
|
|
|
|
state: restarted
|
|
|
|
|
|
|
|
- name: restart libvirtd
|
|
|
|
service:
|
|
|
|
name: libvirtd
|
|
|
|
state: restarted
|
|
|
|
|
|
|
|
- name: restart frr
|
|
|
|
service:
|
|
|
|
name: frr
|
|
|
|
state: restarted
|
|
|
|
|
|
|
|
- name: restart patroni
|
|
|
|
service:
|
|
|
|
name: patroni
|
|
|
|
state: restarted
|
|
|
|
|
2019-12-25 13:27:37 -05:00
|
|
|
# Restart services one-at-a-time
|
|
|
|
# Ideally, this would be accomplished by a serial=1, but Ansible doesn't support that and
|
|
|
|
# likely never will. Instead, we just run the service restart manually, waiting X seconds
|
|
|
|
# before each iteration, where X is 15 seconds times the "host_id" minus 1. Thus, the
|
|
|
|
# following host configuration leads to the specified sleep times:
|
|
|
|
# * pvchv1: 0s
|
|
|
|
# * pvchv2: 15s
|
|
|
|
# * pvchv3: 30s
|
|
|
|
# * etc.
|
|
|
|
# This results in a practical sense in a "serial=1" sequence of restarts allowing the service
|
|
|
|
# to float its primary around after changing a configuration.
|
2019-12-25 13:45:29 -05:00
|
|
|
# Note that this only applies to coordinators; hypervisor-only nodes restart immediately in
|
|
|
|
# parallel, and the first two of three handlers do not apply to hypervisor-only nodes.
|
2019-06-18 21:37:42 -04:00
|
|
|
- name: restart ceph-mon
|
2021-07-30 11:46:49 -04:00
|
|
|
shell: "{% if is_coordinator %}sleep {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ inventory_hostname.split('.')[0] }}.service{% endif %}"
|
2019-12-25 13:27:37 -05:00
|
|
|
ignore_errors: true
|
2019-06-18 21:37:42 -04:00
|
|
|
|
|
|
|
- name: restart ceph-mgr
|
2021-07-30 11:46:49 -04:00
|
|
|
shell: "{% if is_coordinator %}sleep {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ inventory_hostname.split('.')[0] }}.service{% endif %}"
|
2019-12-25 13:27:37 -05:00
|
|
|
ignore_errors: true
|
2019-06-18 21:37:42 -04:00
|
|
|
|
2020-02-08 19:26:51 -05:00
|
|
|
- name: restart pvcnoded
|
2021-07-30 11:46:49 -04:00
|
|
|
shell: "{% if is_coordinator %}sleep {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} &&{% endif %} systemctl restart pvcnoded.service"
|
2019-12-24 14:15:52 -05:00
|
|
|
ignore_errors: true
|
2020-02-20 14:34:29 -05:00
|
|
|
when: bootstrap is not defined
|
2021-05-13 10:14:57 -04:00
|
|
|
|
|
|
|
- name: restart pvcapid
|
2021-07-30 11:46:49 -04:00
|
|
|
shell: "{% if is_coordinator %}sleep {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} &&{% endif %} systemctl restart pvcapid.service"
|
2021-05-13 10:14:57 -04:00
|
|
|
ignore_errors: true
|
|
|
|
when: bootstrap is not defined
|