mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Installer: quote password where it applies
Prior to this change, password having shell interpretable character
would break the installer (e.g '&', '(', etc... )
This commits rely on the `quote` filter from ansible to ensure those
password are properly quoted where it applies
Fixes: https://github.com/ansible/awx/issues/3943
Signed-off-by: Yanis Guenane <yguenane@redhat.com>
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
- name: Dump database
|
||||
shell: |
|
||||
{{ kubectl_or_oc }} -n {{ kubernetes_namespace }} exec ansible-tower-management -- \
|
||||
bash -c "PGPASSWORD={{ pg_password }} \
|
||||
bash -c "PGPASSWORD={{ pg_password | quote }} \
|
||||
pg_dump --clean --create \
|
||||
--host='{{ pg_hostname | default('postgresql') }}' \
|
||||
--port={{ pg_port | default('5432') }} \
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
-e DATABASE_SERVICE_NAME=postgresql \
|
||||
-e POSTGRESQL_MAX_CONNECTIONS={{ pg_max_connections|default(1024) }} \
|
||||
-e POSTGRESQL_USER={{ pg_username }} \
|
||||
-e POSTGRESQL_PASSWORD={{ pg_password }} \
|
||||
-e POSTGRESQL_ADMIN_PASSWORD={{ pg_password }} \
|
||||
-e POSTGRESQL_PASSWORD={{ pg_password | quote }} \
|
||||
-e POSTGRESQL_ADMIN_PASSWORD={{ pg_password | quote }} \
|
||||
-e POSTGRESQL_DATABASE={{ pg_database }} \
|
||||
-e POSTGRESQL_VERSION=9.6 \
|
||||
-n {{ kubernetes_namespace }}
|
||||
@@ -84,7 +84,7 @@
|
||||
helm upgrade {{ postgresql_service_name }} --install \
|
||||
--namespace {{ kubernetes_namespace }} \
|
||||
--set postgresqlUsername={{ pg_username }} \
|
||||
--set postgresqlPassword={{ pg_password }} \
|
||||
--set postgresqlPassword={{ pg_password | quote }} \
|
||||
--set postgresqlDatabase={{ pg_database }} \
|
||||
--set persistence.size={{ pg_volume_capacity|default('5')}}Gi \
|
||||
--version="2.0.0" \
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
- name: Temporarily grant createdb role
|
||||
shell: |
|
||||
{{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
|
||||
exec -i ansible-tower-management -- bash -c "PGPASSWORD={{ pg_password }} \
|
||||
exec -i ansible-tower-management -- bash -c "PGPASSWORD={{ pg_password | quote }} \
|
||||
psql \
|
||||
--host={{ pg_hostname | default('postgresql') }} \
|
||||
--port={{ pg_port | default('5432') }} \
|
||||
@@ -87,7 +87,7 @@
|
||||
- name: Perform a PostgreSQL restore
|
||||
shell: |
|
||||
{{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
|
||||
exec -i ansible-tower-management -- bash -c "PGPASSWORD={{ pg_password }} \
|
||||
exec -i ansible-tower-management -- bash -c "PGPASSWORD={{ pg_password | quote }} \
|
||||
psql \
|
||||
--host={{ pg_hostname | default('postgresql') }} \
|
||||
--port={{ pg_port | default('5432') }} \
|
||||
@@ -98,7 +98,7 @@
|
||||
- name: Revoke createdb role
|
||||
shell: |
|
||||
{{ kubectl_or_oc }} -n {{ kubernetes_namespace }} \
|
||||
exec -i ansible-tower-management -- bash -c "PGPASSWORD={{ pg_password }} \
|
||||
exec -i ansible-tower-management -- bash -c "PGPASSWORD={{ pg_password | quote }} \
|
||||
psql \
|
||||
--host={{ pg_hostname | default('postgresql') }} \
|
||||
--port={{ pg_port | default('5432') }} \
|
||||
|
||||
Reference in New Issue
Block a user