Hi,
I inherited the following AWX installation:
- Ubuntu 18.04 on an AWS EC2 instance
- AWX 16.0.0 running in docker containers (awx_web and awx_task)
- the AWX database is an AWS RDS PostgreSQL.
Now I try to upgrade AWX to latest 20.x (though 19.x would be fine too)
I tried to follow the steps described here: https://github.com/ansible/awx/blob/devel/tools/docker-compose/docs/data_migration.md
But I got stuck at the first step. I did a git pull locally and then I ran:
ansible-playbook -i tools/docker-compose/inventory tools/docker-compose/ansible/migrate.yml -e “old_docker_compose_dir=~/.awx/awxcompose”
The difference between the procedure explained at the above link and my local setup is that the procedure is for PostgreSQL running containerized, but my PostgreSQL instance is an RDS one and I want to keep it like that.
Possibly because of that, I got the following errors:
TASK [migrate : Remove awx_postgres to ensure consistent start state] ***************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: “docker rm -f awx_postgres\n”, “delta”: “0:00:00.045924”, “end”: “2022-03-11 09:32:51.594861”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2022-03-11 09:32:51.548937”, “stderr”: “Error: No such container: awx_postgres”, “stderr_lines”: [“Error: No such container: awx_postgres”], “stdout”: “”, “stdout_lines”: }
…ignoring
TASK [migrate : Start Local Docker database container] ******************************************************************************************************************************************************************************
ok: [localhost]
TASK [migrate : Wait for postgres to initialize] ************************************************************************************************************************************************************************************
ok: [localhost]
TASK [migrate : Database dump to local filesystem] **********************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: “docker-compose -f ~/.awx/awxcompose/docker-compose.yml exec -T postgres pg_dumpall -U awx > awx_dump.sql\n”, “delta”: “0:00:00.687348”, “end”: “2022-03-11 09:32:56.891168”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2022-03-11 09:32:56.203820”, “stderr”: “”, “stderr_lines”: , “stdout”: “”, “stdout_lines”: }
PLAY RECAP **************************************************************************************************************************************************************************************************************************
localhost : ok=21 changed=2 unreachable=0 failed=1 skipped=1 rescued=0 ignored=1
I didn’t know what to do next so I abandoned this approach and I tried differently.
I stopped and deleted the awx_task and awx_web containers and I updated the docker-compose.yml file that was used to launch the stack.
Basically I changed the AWX version of the used images, from ansible/awx:16.0.0 to quay.io/ansible/awx:20.0.1.
Then I ran docker-compose -f docker-compose.yml up. The process started, the new images got downloaded but I got stuck in the following loop:
awx_task | [wait-for-migrations] Attempt 23 of 30
awx_web | [wait-for-migrations] Waiting 30 seconds before next attempt
awx_task | [wait-for-migrations] Waiting 30 seconds before next attempt
awx_web | [wait-for-migrations] Attempt 24 of 30
awx_task | [wait-for-migrations] Attempt 24 of 30
awx_task | [wait-for-migrations] Waiting 30 seconds before next attempt
awx_web | [wait-for-migrations] Waiting 30 seconds before next attempt
What I want to achieve is:
- upgrade AWX to latest 20.x (but 19.x would be fine too)
- do not loose my database content, because I have a lot of settings there. So I need to find a way to migrate it.
- keep the database on RDS
I don’t mind to completely ditch the containerized approach and have an installation directly on the host, as long as I cover all the points above.
I don’t mind also to do the upgrades one by one instead of directly going to 20.x, if this would be a solution.
But honestly I’m completely stuck.
By the way, I still have the inventory file used at the initial installation, in case it is important.
So, any idea on how should I proceed?
Thank you,
Ciprian