Skip to content

Commit

Permalink
PgBackRest: Enable asynchronous WAL archiving (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Nov 21, 2023
1 parent 431a1ea commit 9b27898
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
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 @@ -489,7 +489,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 @@ -504,6 +504,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

0 comments on commit 9b27898

Please sign in to comment.