mirror of
https://gitea.0xace.cc/ansible-galaxy/postgresql.git
synced 2025-01-18 20:12:23 +00:00
fix restore
This commit is contained in:
parent
559cbfead1
commit
75662652c7
@ -22,6 +22,10 @@ postgresql_wal_g_restore_config_name: ".walg-restore.json"
|
|||||||
postgresql_wal_g_pitr: 'latest'
|
postgresql_wal_g_pitr: 'latest'
|
||||||
postgresql_wal_g_restore_backup_name: 'LATEST'
|
postgresql_wal_g_restore_backup_name: 'LATEST'
|
||||||
postgresql_wal_g_binary_name: "wal-g-pg"
|
postgresql_wal_g_binary_name: "wal-g-pg"
|
||||||
|
#postgresql_postgresql_archive_command: "wal-g wal-push %p"
|
||||||
|
#postgresql_postgresql_restore_command: "wal-g wal-fetch %f %p"
|
||||||
|
#postgresql_restore_dbs_from_backup_command: "wal-g backup-fetch {{ postgresql_wal_g_restore_backup_name }}"
|
||||||
|
#postgresql_restore_wals_from_backup_command: "wal-g wal-fetch %f %p"
|
||||||
|
|
||||||
postgresql_recovery_target_time: ""
|
postgresql_recovery_target_time: ""
|
||||||
postgresql_promote_trigger_file: "{{ postgresql_data_dir }}/promote.trigger"
|
postgresql_promote_trigger_file: "{{ postgresql_data_dir }}/promote.trigger"
|
||||||
@ -68,6 +72,7 @@ postgresql_restore_parameters:
|
|||||||
|
|
||||||
postgresql_log_dir: "/var/log/postgresql"
|
postgresql_log_dir: "/var/log/postgresql"
|
||||||
|
|
||||||
|
|
||||||
postgresql_supported_versions:
|
postgresql_supported_versions:
|
||||||
- 13
|
- 13
|
||||||
- 14
|
- 14
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
become_user: postgres
|
become_user: postgres
|
||||||
|
|
||||||
- name: Check if d folder is empty before proceeding
|
- name: Check if database folder is empty before proceeding
|
||||||
find:
|
find:
|
||||||
paths: "{{ postgresql_data_dir }}"
|
paths: "{{ postgresql_data_dir }}"
|
||||||
register: postgresql_files_found
|
register: postgresql_files_found
|
||||||
@ -29,13 +29,13 @@
|
|||||||
- postgresql_files_found.matched == 0
|
- postgresql_files_found.matched == 0
|
||||||
block:
|
block:
|
||||||
- name: Restore database dir from backup
|
- 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
|
become_user: postgres
|
||||||
|
|
||||||
- name: Include PostgreSQL configuration
|
- name: Include PostgreSQL configuration
|
||||||
vars:
|
vars:
|
||||||
postgresql_archive_command: "cd ."
|
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
|
include_tasks: config.yaml
|
||||||
|
|
||||||
- name: Create recovery.signal file
|
- name: Create recovery.signal file
|
||||||
|
Loading…
Reference in New Issue
Block a user