Ansible - Getting Started with tower-cli
by
Jeremy Canfield |
Updated: May 23 2023
| Ansible articles
By default, the Ansible Tower command line tool is not installed. These examples are based on Linux. First, install pip. Then, install the command line interface.
pip install ansible-tower-cli
The tower-cli command is then used to issue commands. For example, to list the tower-cli version.
~]$ tower-cli --version
Tower CLI 3.3.9
For example, the following probably are configs you probably want to make.
tower-cli config username your_username
tower-cli config password your_password
tower-cli config host https://tower.example.com
tower-cli config verify_ssl false
Which should then be stored in the hidden tower_cli.cfg file.
~]$ cat /home/john.doe/.tower_cli.cfg
[general]
username = john.doe
password = itsasecret
host = https://tower.example.com
verify_ssl = false
Assuming at least one Job Template has been created in Tower, the job_template list command should return the Job Templates.
~]$ tower-cli job_template list
===== ====================== ========= ======= ===========
id name inventory project playbook
==== ====================== ========= ======= ===========
991 my job template 123 456 example.yml
Did you find this article helpful?
If so, consider buying me a coffee over at