From 372b949930966cd5e383db76b2ef4015a961d37e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:22 -0400 Subject: [PATCH] Apply fix with some tweaks to other serial handlers --- roles/pvc/handlers/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/pvc/handlers/main.yml b/roles/pvc/handlers/main.yml index 078fd74..2f72826 100644 --- a/roles/pvc/handlers/main.yml +++ b/roles/pvc/handlers/main.yml @@ -30,14 +30,16 @@ # * 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. +# 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. - name: restart ceph-mon - shell: sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ ansible_hostname }}.service + shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ ansible_hostname }}.service{% endif %}" ignore_errors: true - name: restart ceph-mgr - shell: sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ ansible_hostname }}.service + shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ ansible_hostname }}.service{% endif %}" ignore_errors: true - name: restart pvcd - shell: sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart pvcd.service + shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} &&{% endif %} systemctl restart pvcd.service" ignore_errors: true