2023-09-01 15:42:19 -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
|
|
|
|
|
2023-09-01 15:42:22 -04: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.
|
2023-09-01 15:42:20 -04:00
|
|
|
- name: restart ceph-mon
|
2023-09-01 15:42:22 -04:00
|
|
|
shell: sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ ansible_hostname }}.service
|
|
|
|
ignore_errors: true
|
2023-09-01 15:42:20 -04:00
|
|
|
|
|
|
|
- name: restart ceph-mgr
|
2023-09-01 15:42:22 -04:00
|
|
|
shell: sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ ansible_hostname }}.service
|
|
|
|
ignore_errors: true
|
2023-09-01 15:42:20 -04:00
|
|
|
|
2023-09-01 15:42:19 -04:00
|
|
|
- name: restart pvcd
|
2023-09-01 15:42:22 -04:00
|
|
|
shell: sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart pvcd.service
|
2023-09-01 15:42:22 -04:00
|
|
|
ignore_errors: true
|