mirror of
https://github.com/ansible/awx-operator.git
synced 2026-04-27 08:56:41 +00:00
Merge pull request #137 from Zokormazo/backup-read-default-old-configuration
Check the default old PostgreSQL configuration
This commit is contained in:
@@ -14,14 +14,26 @@
|
||||
name: '{{ meta.name }}-postgres-configuration'
|
||||
register: _default_pg_config_resources
|
||||
|
||||
- name: Check for old PostgreSQL configuration secret
|
||||
- name: Check for specified old PostgreSQL configuration secret
|
||||
k8s_info:
|
||||
kind: Secret
|
||||
namespace: '{{ meta.namespace }}'
|
||||
name: '{{ tower_old_postgres_configuration_secret }}'
|
||||
register: old_pg_config
|
||||
register: _custom_old_pg_config_resources
|
||||
when: tower_old_postgres_configuration_secret | length
|
||||
|
||||
- name: Check for default old PostgreSQL configuration
|
||||
k8s_info:
|
||||
kind: Secret
|
||||
namespace: '{{ meta.namespace }}'
|
||||
name: '{{ meta.name }}-old-postgres-configuration'
|
||||
register: _default_old_pg_config_resources
|
||||
|
||||
- name: Set old PostgreSQL configuration
|
||||
set_fact:
|
||||
# yamllint disable-line rule:line-length
|
||||
old_pg_config: '{{ _custom_old_pg_config_resources["resources"] | default([]) | length | ternary(_custom_old_pg_config_resources, _default_old_pg_config_resources) }}' # noqa 204
|
||||
|
||||
- name: Set proper database name when migrating from old deployment
|
||||
set_fact:
|
||||
database_name: "{{ old_pg_config['resources'][0]['data']['database'] | b64decode }}"
|
||||
|
||||
Reference in New Issue
Block a user