fix restore

This commit is contained in:
ace
2023-07-31 23:44:44 +03:00
parent 559cbfead1
commit 75662652c7
2 changed files with 8 additions and 3 deletions

View File

@ -19,7 +19,7 @@
state: directory
become_user: postgres
- name: Check if d folder is empty before proceeding
- name: Check if database folder is empty before proceeding
find:
paths: "{{ postgresql_data_dir }}"
register: postgresql_files_found
@ -29,13 +29,13 @@
- postgresql_files_found.matched == 0
block:
- name: Restore database dir from backup
shell: "{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' backup-fetch ' ~ postgresql_data_dir ~ ' ' ~ postgresql_wal_g_restore_backup_name }}"
shell: "{{ postgresql_restore_dbs_from_backup_command }}"
become_user: postgres
- name: Include PostgreSQL configuration
vars:
postgresql_archive_command: "cd ."
postgresql_restore_command: "{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' wal-fetch %f %p' }}"
postgresql_restore_command: "{{ postgresql_restore_wals_from_backup_command }}"
include_tasks: config.yaml
- name: Create recovery.signal file