mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
Copy over downstream change
Allows users to specify pg_username that has uppercase letters to restore succesfully
This commit is contained in:
@@ -98,7 +98,7 @@
|
|||||||
POD=$({{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
|
POD=$({{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
|
||||||
get pods -l=name=postgresql --field-selector status.phase=Running -o jsonpath="{.items[0].metadata.name}")
|
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 "\
|
{{ 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
|
- name: Perform a PostgreSQL restore
|
||||||
shell: |
|
shell: |
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
POD=$({{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
|
POD=$({{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
|
||||||
get pods -l=name=postgresql --field-selector status.phase=Running -o jsonpath="{.items[0].metadata.name}")
|
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 "\
|
{{ 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 == ''
|
when: pg_hostname is not defined or pg_hostname == ''
|
||||||
|
|
||||||
- name: Remove restore directory
|
- name: Remove restore directory
|
||||||
|
|||||||
Reference in New Issue
Block a user