Skip to content

Commit

Permalink
Modify how pg password is set in postgres pod (#1540)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian M. Adams <[email protected]>
  • Loading branch information
rooftopcellist authored Aug 29, 2023
1 parent 1dc64b5 commit 7012a6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion roles/installer/tasks/migrate_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
trap 'end_keepalive \"$keepalive_file\" \"$keepalive_pid\"' EXIT SIGINT SIGTERM
echo keepalive_pid: $keepalive_pid
set -e -o pipefail
PGPASSWORD='{{ awx_old_postgres_pass }}' {{ pgdump }} | PGPASSWORD='{{ awx_postgres_pass }}' {{ pg_restore }}
PGPASSWORD=\"$PGPASSWORD_OLD\" {{ pgdump }} | PGPASSWORD=\"$POSTGRES_PASSWORD\" {{ pg_restore }}
set +e +o pipefail
echo 'Successful'
"
Expand Down
7 changes: 7 additions & 0 deletions roles/installer/templates/statefulsets/postgres.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ spec:
value: '{{ postgres_initdb_args }}'
- name: POSTGRES_HOST_AUTH_METHOD
value: '{{ postgres_host_auth_method }}'
{% if 'resources' in old_pg_config and old_pg_config['resources'] and 'password' in old_pg_config['resources'][0]['data'] %}
- name: PGPASSWORD_OLD
valueFrom:
secretKeyRef:
name: '{{ old_pg_config['resources'][0]['metadata']['name'] }}'
key: password
{% endif %}
ports:
- containerPort: {{ awx_postgres_port | default('5432')}}
name: postgres-{{ supported_pg_version }}
Expand Down

0 comments on commit 7012a6a

Please sign in to comment.