Ansible Tower list of hosts - License

Hello,

I am looking for a way to extract a spreadsheet from Tower API with the list of hosts, so I can see what inventory includes each host, organizations using it, and when was the last time it was used. This will help to verify if the number of lines in this list matches the license consumed in Ansible Tower. This will help to report and plan any cleanup for unused hosts in inventories.

Thanks,

Alberto

The best way to do this is to make GET requests to the api/v2/hosts endpoint, then parse that json to get he relevant fields/data and write them to a .csv

You can also do this with awx collection, which can also output to json

Try that out and let us know if you run into problems along the way, happy to help further

AWX Team