use postgresql_home_dir

This commit is contained in:
ace
2023-02-21 16:14:02 +03:00
parent 98b48a3566
commit 9207b91282
7 changed files with 15 additions and 13 deletions

View File

@ -31,7 +31,7 @@
name: wal-g
vars:
wal_g_pg: yes
wal_g_pg_home_dir: "{{ postgresql_base_dir }}"
wal_g_pg_home_dir: "{{ postgresql_home_dir }}"
wal_g_pg_data_dir: "{{ postgresql_data_dir }}"
wal_g_restore: "{{ postgresql_wal_g_restore }}"
when: postgresql_wal_g_install

View File

@ -14,7 +14,7 @@
- name: Set facts about needed vars
set_fact:
postgresql_base_dir: "{{ postgresql_base_dir }}"
postgresql_home_dir: "{{ postgresql_home_dir }}"
postgresql_data_dir: "{{ postgresql_data_dir }}"
- name: "Set locale for PostgreSQL"

View File

@ -29,12 +29,12 @@
- postgresql_files_found.matched == 0
block:
- name: Restore database dir from backup
shell: "{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_base_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' backup-fetch ' ~ postgresql_data_dir ~ ' ' ~ postgresql_wal_g_postgresql_pitr }}"
shell: "{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' backup-fetch ' ~ postgresql_data_dir ~ ' ' ~ postgresql_wal_g_postgresql_pitr }}"
become_user: postgres
- name: Include PostgreSQL configuration
vars:
postgresql_restore_command: "{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_base_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' wal-fetch %f %p' }}"
postgresql_restore_command: "{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' wal-fetch %f %p' }}"
include_tasks: config.yaml
- name: Create recovery.signal file