From 6e51b23e8681e224087203aa75fedd0f8ca50a59 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 18 Jun 2019 13:07:53 -0400 Subject: [PATCH] Make restart hander for pvcd sequential --- roles/pvc/handlers/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/pvc/handlers/main.yml b/roles/pvc/handlers/main.yml index 0a59472..50eba47 100644 --- a/roles/pvc/handlers/main.yml +++ b/roles/pvc/handlers/main.yml @@ -19,7 +19,13 @@ name: patroni state: restarted +# Restart pvcd, but sequentially one-host-at-a-time with a 15s wait in between; this provides +# plenty of time for the primary state to switch around without putting the cluster in a +# no-primary state - name: restart pvcd - service: - name: pvcd - state: restarted + shell: systemctl restart pvcd && sleep 15 + run_once: true + delegate_to: "{{ play_host }}" + with_items: "{{ play_hosts }}" + loop_control: + loop_var: play_host