Ansible Tower list of hosts - License

81 views
Skip to first unread message

Alberto Cortes

unread,
Nov 25, 2022, 10:27:17 AM11/25/22
to AWX Project
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


AWX Project

unread,
Dec 2, 2022, 1:47:56 PM12/2/22
to AWX Project
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
Reply all
Reply to author
Forward
0 new messages