mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-08 06:12:54 +00:00
Merge pull request #296 from rooftopcellist/pg_custom_archive
Use custom archive format when migrating data
This commit is contained in:
@@ -41,18 +41,19 @@
|
|||||||
- name: Set pg_dump command
|
- name: Set pg_dump command
|
||||||
set_fact:
|
set_fact:
|
||||||
pgdump: >-
|
pgdump: >-
|
||||||
pg_dump --clean --create
|
pg_dump
|
||||||
-h {{ awx_old_postgres_host }}
|
-h {{ awx_old_postgres_host }}
|
||||||
-U {{ awx_old_postgres_user }}
|
-U {{ awx_old_postgres_user }}
|
||||||
-d {{ awx_old_postgres_database }}
|
-d {{ awx_old_postgres_database }}
|
||||||
-p {{ awx_old_postgres_port }}
|
-p {{ awx_old_postgres_port }}
|
||||||
|
-F custom
|
||||||
|
|
||||||
- name: Set pg_restore command
|
- name: Set pg_restore command
|
||||||
set_fact:
|
set_fact:
|
||||||
psql_restore: >-
|
pg_restore: >-
|
||||||
psql -U {{ database_username }}
|
pg_restore --clean --if-exists
|
||||||
-d template1
|
-U {{ database_username }}
|
||||||
-p {{ awx_postgres_port }}
|
-d {{ database_name }}
|
||||||
|
|
||||||
- name: Stream backup from pg_dump to the new postgresql container
|
- name: Stream backup from pg_dump to the new postgresql container
|
||||||
k8s_exec:
|
k8s_exec:
|
||||||
@@ -61,7 +62,7 @@
|
|||||||
command: |
|
command: |
|
||||||
bash -c """
|
bash -c """
|
||||||
set -e -o pipefail
|
set -e -o pipefail
|
||||||
PGPASSWORD={{ awx_old_postgres_pass }} {{ pgdump }} | PGPASSWORD={{ awx_postgres_pass }} {{ psql_restore }}
|
PGPASSWORD={{ awx_old_postgres_pass }} {{ pgdump }} | PGPASSWORD={{ awx_postgres_pass }} {{ pg_restore }}
|
||||||
echo 'Successful'
|
echo 'Successful'
|
||||||
"""
|
"""
|
||||||
register: data_migration
|
register: data_migration
|
||||||
|
|||||||
Reference in New Issue
Block a user