Why Ansible Tower Setup Is Failing with 'syntax error' At 'Create the awx postgres user' or 'Perform a PostgreSQL dump' task ?

Solution Verified - Updated -

Issue

Ansible Tower installer fails with 'Syntax Error' for the 'Create the awx postgres user' or 'Perform a PostgreSQL dump' task like below. This issue occurs for both the Standard Ansible Tower installer or the Ansible Tower installer for OpenShift for the PostgreSQL tasks.

Setup failing for Ansible Tower installer (OpenShift)

TASK [kubernetes : Dump database] ***************************************************************************************************************************
^[[0;31mfatal: [localhost]: FAILED! => {"changed": true, "cmd": "oc --config=/tmp/ansible-tower-config/.kube/config -n tower exec ansible-tower-management -- bash -c \"PGPASSWORD=$$'\"5/<g!&ogMR6BP`N\"' \\\nscl enable rh-postgresql10 -- pg_dump --clean --create \\\n--host='postgresql' \\\n--port=5432 \\\n--username='postgres' \\\n--dbname='postgres'\" > /root/ansible-tower-openshift-setup-3.6.2/tower-openshift-backup-2020-04-22-14:44:25/tower.db", "delta": "0:00:00.007403", "end": "2020-04-22 14:44:51.374137", "msg": "non-zero return code", "rc": 1, "start": "2020-04-22 14:44:51.366734", "stderr": "/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'\n/bin/sh: -c: line 6: syntax error: unexpected end of file", "stderr_lines": ["/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'", "/bin/sh: -c: line 6: syntax error: unexpected end of file"], "stdout": "", "stdout_lines": []}^[[0m
to retry, use: --limit @/root/ansible-tower-openshift-setup-3.6.2/backup.retry

Setup failing for Ansible Tower installer (Standard)

TASK [postgres : create the awx postgres user if it does not exist and set the password] ***************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["scl", "enable", "rh-postgresql10", "--", "psql", "-c", "CREATE USER awx WITH ENCRYPTED PASSWORD '$$'\"5/<g!&ogMR6BP`N\'';"], "delta": "0:00:00.008516", "end": "2020-04-23 07:30:55.529865", "msg": "non-zero return code", "rc": 2, "start": "2020-04-23 07:30:55.521349", "stderr": "/var/tmp/sclxcAmny: line 8: unexpected EOF while looking for matching ``'\n/var/tmp/sclxcAmny: line 9: syntax error: unexpected end of file", "stderr_lines": ["/var/tmp/sclxcAmny: line 8: unexpected EOF while looking for matching ``'", "/var/tmp/sclxcAmny: line 9: syntax error: unexpected end of file"], "stdout": "", "stdout_lines": []}

Environment

Ansible Tower

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In