问题原文
原帖链接 · user597296 · CC BY-SA 4.0
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.
已采纳解答
原帖链接 · TRW · CC BY-SA 4.0
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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
