Copy over downstream change

Allows users to specify pg_username that has uppercase letters to restore succesfully
This commit is contained in:
Shane McDonald 2020-07-01 14:40:38 -04:00
parent e3e69b4c6b
commit 7f81f530fa
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374

View File

@ -98,7 +98,7 @@
POD=$({{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
get pods -l=name=postgresql --field-selector status.phase=Running -o jsonpath="{.items[0].metadata.name}")
{{ kubectl_or_oc }} exec $POD -n {{ kubernetes_namespace }} -- bash -c "\
psql --dbname=template1 -c 'ALTER USER {{ pg_username }} CREATEDB;'"
psql --dbname=template1 -c 'ALTER USER \"{{ pg_username }}\" CREATEDB;'"
- name: Perform a PostgreSQL restore
shell: |
@ -113,7 +113,7 @@
POD=$({{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
get pods -l=name=postgresql --field-selector status.phase=Running -o jsonpath="{.items[0].metadata.name}")
{{ kubectl_or_oc }} exec $POD -n {{ kubernetes_namespace }} -- bash -c "\
psql --dbname=template1 -c 'ALTER USER {{ pg_username }} NOCREATEDB;'"
psql --dbname=template1 -c 'ALTER USER \"{{ pg_username }}\" NOCREATEDB;'"
when: pg_hostname is not defined or pg_hostname == ''
- name: Remove restore directory