Automate import of project sourced inventories?

I have 150 yml inventories in git I need to bring into AWX. My job templates will require the user to pick one inventory per job, and each inventory has the same groups, so it should be easy on the user.

I can bring the inventories in from the GUI just fine, but can I create a template to do this? Ideally, I would list a directory, loop the found items, create an inventory, create a project source, sync it. After that, update on launch should keep things happy.

Thanks.

Kevin

Have you look into the awx.awx collection? https://galaxy.ansible.com/awx/awx
That should let you interface with awx from Ansible.

-John

I eventually got to the idea awx-cli might be the tool I’m hunting, and am now trying to make that work. Thank you. After I have it working, it would probably make good sense to use awx.awx to automate it. I’ll keep that in my back pocket. :slight_smile:

Kevin