Donate to help keep this project maintained
This is a unofficial python API client for Ansible AWX.
- requests
pip install ansibleawx-client
You can do this with your username and password or using your Token.
import ansibleawx
API_URL = "http://my-ansibleawx.com/api/v2"
client = ansibleawx.Api("username", "password", api_url=API_URL)
import ansibleawx
API_URL = "http://my-ansibleawx.com/api/v2"
TOKEN = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
client = ansibleawx.Api(api_url=API_URL, token=TOKEN)
# to get all inventories
response = client.get_inventories()
# to get specific inventory by id
response = client.get_inventories(1)
# to get all jobs templates
response = client.get_jobs_templates()
# to get specific job template by id
response = client.get_jobs_templates(1)
response = client.launch_job_template(1)
response = client.relaunch_job(1)
response = client.cancel_job(1)
Consult the Ansible Tower documentation for more details.