Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PgBackRest: Enable asynchronous WAL archiving #515

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions roles/pgbackrest/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@
tags: pgbackrest, pgbackrest_install

- block:
- name: Ensure spool directory exist
ansible.builtin.file:
path: "{{ item.value }}"
state: directory
owner: postgres
group: postgres
mode: "0750"
loop: "{{ pgbackrest_conf.global }}"
when: item.option == 'spool-path'
loop_control:
label: "{{ item.value }}"

- name: Ensure config directory exist
ansible.builtin.file:
path: "{{ pgbackrest_conf_file | dirname }}"
Expand Down
6 changes: 5 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ pgbackrest_repo_type: "posix" # or "s3", "gcs", "azure"
pgbackrest_repo_host: "" # dedicated repository host (optional)
pgbackrest_repo_user: "postgres"
pgbackrest_conf_file: "/etc/pgbackrest/pgbackrest.conf"
# see more options https://pgbackrest.org/configuration.html
# config https://pgbackrest.org/configuration.html
pgbackrest_conf:
global: # [global] section
- { option: "log-level-file", value: "detail" }
Expand All @@ -500,6 +500,10 @@ pgbackrest_conf:
- { option: "stop-auto", value: "y" }
- { option: "resume", value: "n" }
- { option: "link-all", value: "y" }
- { option: "spool-path", value: "/var/spool/pgbackrest" }
- { option: "archive-async", value: "y" } # Enables asynchronous WAL archiving (details: https://pgbackrest.org/user-guide.html#async-archiving)
- { option: "archive-get-queue-max", value: "1GiB" }
# - { option: "archive-push-queue-max", value: "100GiB" }
# - { option: "", value: "" }
stanza: # [stanza_name] section
- { option: "pg1-path", value: "{{ postgresql_data_dir }}" }
Expand Down