mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Use custom pg_dump format for faster restores
This commit is contained in:
@@ -85,6 +85,7 @@
|
|||||||
-U {{ awx_postgres_user }}
|
-U {{ awx_postgres_user }}
|
||||||
-d {{ awx_postgres_database }}
|
-d {{ awx_postgres_database }}
|
||||||
-p {{ awx_postgres_port }}
|
-p {{ awx_postgres_port }}
|
||||||
|
-F custom
|
||||||
|
|
||||||
- name: Write pg_dump to backup on PVC
|
- name: Write pg_dump to backup on PVC
|
||||||
k8s_exec:
|
k8s_exec:
|
||||||
|
|||||||
@@ -63,8 +63,9 @@
|
|||||||
|
|
||||||
- name: Set pg_restore command
|
- name: Set pg_restore command
|
||||||
set_fact:
|
set_fact:
|
||||||
psql_restore: >-
|
pg_restore: >-
|
||||||
psql -U {{ awx_postgres_user }}
|
pg_restore --clean --if-exists
|
||||||
|
-U {{ awx_postgres_user }}
|
||||||
-h {{ resolvable_db_host }}
|
-h {{ resolvable_db_host }}
|
||||||
-U {{ awx_postgres_user }}
|
-U {{ awx_postgres_user }}
|
||||||
-d {{ awx_postgres_database }}
|
-d {{ awx_postgres_database }}
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
command: |
|
command: |
|
||||||
bash -c """
|
bash -c """
|
||||||
set -e -o pipefail
|
set -e -o pipefail
|
||||||
cat {{ backup_dir }}/tower.db | PGPASSWORD={{ awx_postgres_pass }} {{ psql_restore }}
|
cat {{ backup_dir }}/tower.db | PGPASSWORD={{ awx_postgres_pass }} {{ pg_restore }}
|
||||||
echo 'Successful'
|
echo 'Successful'
|
||||||
"""
|
"""
|
||||||
register: data_migration
|
register: data_migration
|
||||||
|
|||||||
Reference in New Issue
Block a user