From 4b9cd66b9ed01b6eb118b01db889f6faf748b5b9 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:39:52 +0300 Subject: [PATCH 1/2] pgBackRest: Add '--no-online' option to stanza-create Add '--no-online' option to stanza-create to be able to configure on a Standby cluster. --- roles/pgbackrest/stanza-create/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/pgbackrest/stanza-create/tasks/main.yml b/roles/pgbackrest/stanza-create/tasks/main.yml index 8395f97e6..9b508888c 100644 --- a/roles/pgbackrest/stanza-create/tasks/main.yml +++ b/roles/pgbackrest/stanza-create/tasks/main.yml @@ -55,7 +55,7 @@ become_user: "{{ pgbackrest_repo_user }}" delegate_to: "{{ groups['pgbackrest'][0] }}" run_once: true - ansible.builtin.command: "pgbackrest --stanza={{ pgbackrest_stanza }} stanza-create" + ansible.builtin.command: "pgbackrest --stanza={{ pgbackrest_stanza }} --no-online stanza-create" register: stanza_create_result changed_when: - stanza_create_result.rc == 0 From 28228d1e2db55e44ce3a26916743ebcd2ecae80e Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:41:57 +0300 Subject: [PATCH 2/2] Update pgbackrest_cron_jobs --- vars/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/main.yml b/vars/main.yml index 0bdbc6c45..eb10eea15 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -612,7 +612,7 @@ pgbackrest_cron_jobs: day: "*" month: "*" weekday: "0" - job: "pgbackrest --type=full --stanza={{ pgbackrest_stanza }} backup" + job: "pgbackrest --stanza={{ pgbackrest_stanza }} --type=full backup" # job: "if [ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ]; then pgbackrest --type=full --stanza={{ pgbackrest_stanza }} backup; fi" - name: "pgBackRest: Diff Backup" file: "/etc/cron.d/pgbackrest-{{ patroni_cluster_name }}" @@ -622,7 +622,7 @@ pgbackrest_cron_jobs: day: "*" month: "*" weekday: "1-6" - job: "pgbackrest --type=diff --stanza={{ pgbackrest_stanza }} backup" + job: "pgbackrest --stanza={{ pgbackrest_stanza }} --type=diff backup" # job: "if [ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ]; then pgbackrest --type=diff --stanza={{ pgbackrest_stanza }} backup; fi"