I am attempting to copy all the data (templates, credentials, inventories, etc) from my Ansible Tower production instance to my newly created dev instance. Is there a way to do this automatically using an ansible API? I have attempted to research tower-cli but there doesn't seem to be much information on this use case. Additionally, tower-cli looks to be deprecated.
1 Answers
Yes and no - you can use tower-cli
to receive (backup) and send (restore) the configuration. See https://www.unixarena.com/2019/03/backup-restore-ansible-awx-tower-cli.html/
tower-cli receive --all > config.json
tower-cli send config.json
But - there is no way to backup the credentials. The receive command doesnt export them.
All possible options are documented https://tower-cli.readthedocs.io/en/latest/ but not very good. I found the command line help within tower-cli help
a bit easier to understand.
Also - development is no longer under development. So, be aware that the new client is awxkit. See https://github.com/ansible/awx/tree/devel/awxkit/awxkit/cli/docs - it has the same parameters.
I've got also the answer: make a backup of the AWX database and recover them to the new database (or reuse it) together with the new AWX instance. But I'm not sure, if this is really a 'good' recommended solution.
- 438
- 3
- 14