-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathmain.yml
More file actions
46 lines (35 loc) · 2.36 KB
/
main.yml
File metadata and controls
46 lines (35 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
postgresql_apt_keys_dir: "/etc/apt/keyrings"
postgresql_pgdg_key_dest: "{{ postgresql_apt_keys_dir }}/pgdg.asc"
postgresql_pgdg_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc"
postgresql_pgdg_repo: "deb [signed-by={{ postgresql_pgdg_key_dest }}] http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main"
postgresql_default_version: 15
postgresql_user_name: postgres
postgresql_install_psycopg2: true
# Point-In-Time Recovery (PITR) backup options
# https://www.postgresql.org/docs/current/continuous-archiving.html
postgresql_backup_local_dir: >-
{{ '/var/lib/pgsql' if ansible_os_family == 'RedHat' else (
'/var/lib/postgresql' if ansible_os_family == 'Debian' else '~postgres') }}/backup
postgresql_create_backup_dir: true
# Controls whether the wal_archive directory is cleaned and whether postgresql_create_backup_dir can be used
postgresql_backup_dir_is_remote: "{{ postgresql_backup_dir[0] != '/' }}"
# Options used for the WAL archive command - do not change this unless you have read the PITR documentation and
# understand how this command must work.
postgresql_archive_wal_rsync_args: '--ignore-existing -ptg --info=skip1'
# These options are passed to all calls of rsync (in addition to backups, rsync is used to clean up old backups)
postgresql_backup_rsync_connect_opts: ''
# These options are passed only to the call of rsync that performs the backup
postgresql_backup_rsync_backup_opts: '-rptg'
# Keep this many old backups
postgresql_backup_keep: 30
__postgresql_pgdg_bin_dir: "{{ '/usr/pgsql-' ~ (postgresql_version | replace('.', '')) ~ '/bin' }}"
postgresql_backup_command: >-
{{ postgresql_backup_python_executable }} {{ postgresql_backup_local_dir | quote }}/bin/backup.py
{{ '--rsync-connect-opts ' ~ (postgresql_backup_rsync_connect_opts | quote) if postgresql_backup_rsync_connect_opts else '' }}
--rsync-backup-opts {{ postgresql_backup_rsync_backup_opts | regex_replace('^-', '\-') | quote }}
--keep {{ postgresql_backup_keep | quote }}
{{ '--pg-bin-dir ' ~ __postgresql_pgdg_bin_dir if ansible_os_family == 'RedHat' else '' }}
--backup {{ postgresql_backup_dir_is_remote | ternary('', '--clean-archive') }} {{ postgresql_backup_dir | quote }}
postgresql_backup_python_executable: "python"
postgresql_default_auth_method: "{{ (postgresql_version is version('13', '>')) | ternary('scram-sha-256', 'md5') }}"