From 6d75b33d173c5d6c5353f2604904a5761aae5365 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 7 Nov 2024 02:01:03 -0500 Subject: [PATCH] Correct bugs with Patroni tasks on Ansible 2.14 --- oneshot/upgrade-pvc-cluster_deb12.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/oneshot/upgrade-pvc-cluster_deb12.yml b/oneshot/upgrade-pvc-cluster_deb12.yml index f1b6ec3..d27e9e0 100644 --- a/oneshot/upgrade-pvc-cluster_deb12.yml +++ b/oneshot/upgrade-pvc-cluster_deb12.yml @@ -55,8 +55,8 @@ failed_when: check_output.stdout == "" - name: stop and mask patroni service on followers to perform database upgrade (later) - service: - name: patroni + systemd_service: + name: patroni.service state: stopped masked: yes run_once: yes @@ -67,10 +67,12 @@ shell: cmd: "sudo -u postgres /usr/bin/pg_dumpall > upgrade_dump.sql" chdir: "/var/lib/postgresql" + run_once: yes + delegate_to: "{{ patroni_leader }}" - name: stop and mask patroni service on leader to perform database upgrade (later) - service: - name: patroni + systemd_service: + name: patroni.service state: stopped masked: yes run_once: yes @@ -498,8 +500,8 @@ shell: "/usr/share/zookeeper/bin/zkCli.sh -server {{ ansible_hostname }}:2181 deleteall /patroni/pvc" - name: start patroni service on leader - service: - name: patroni + systemd_service: + name: patroni.service state: started masked: no @@ -535,8 +537,8 @@ loop: "{{ patroni_followers }}" - name: start patroni service on followers - service: - name: patroni + systemd_service: + name: patroni.service state: started masked: no run_once: yes