rewrite restore logic

This commit is contained in:
ace
2023-07-21 17:14:47 +03:00
parent a20385be58
commit e201c69b36
7 changed files with 51 additions and 26 deletions

View File

@ -19,8 +19,11 @@
- name: Merge backup options for PostgreSQL config
set_fact:
postgresql_combined_parameters: "{{ postgresql_combined_parameters | combine(postgresql_backup_parameters|default({}), recursive=true) }}"
when:
postgresql_combined_parameters: "{{ postgresql_combined_parameters | combine(postgresql_backup_parameters, recursive=true) }}"
- name: Merge restore options for PostgreSQL config
set_fact:
postgresql_combined_parameters: "{{ postgresql_combined_parameters | combine(postgresql_restore_parameters, recursive=true) }}"
- name: Propagate PostgreSQL configs
block:

View File

@ -6,6 +6,10 @@
include_tasks: config.yaml
tags: postgresql_configuration
- name: "Manage TLS/SSL certificates"
include_tasks: cacert.yaml
when: postgresql_ssl
- name: Include WAL-G role
ansible.builtin.include_role:
name: wal-g
@ -16,6 +20,10 @@
wal_g_restore: "{{ postgresql_wal_g_restore }}"
when: postgresql_wal_g_install
- name: Include PostgreSQL restore
include_tasks: restore.yaml
when: postgresql_wal_g_restore_from_backup
- name: "PostgreSQL initdb"
become_user: "{{ postgresql_superuser_username }}"
shell: "/usr/lib/postgresql/{{ postgresql_major_version }}/bin/initdb -D {{ postgresql_data_dir }} --username {{ postgresql_superuser_username }} --auth-local peer --auth-host {{ postgresql_password_encryption_algorithm }} --no-instructions"