Hi,
I am using terraform to launch the infrastructure (windows).
1) dynamic inventory of the machine to be registered in Ansible groups.
2.) how can I make rest api call to invoke the Ansible tower job template. ( I had a authentication token ).
Thank you,
Sai
I’m hoping to find some time to actually try this myself (not Terraform specifically) so maybe we can hash out some ideas.
I believe the call of the Ansible job requires an inventory to be defined (no hacking one like can be done on the command line), so a programmatic way to add/update/modify/delete an inventory within Tower is the first step.
In my case we are pretty new to Tower so we haven’t standardized on the naming of the inventory entries. One idea is to generate a temporary inventory entry based on some unique name (based on username & datestamp) and add the new systems to that inventory. You can then run the job against that temporary inventory and delete the inventory when the playbook runs successfully on all the systems in the inventory. Once all are setup, you can delete the inventory (or delete it a few days later if desired).
Another idea is to add the new systems into pre-existing inventories for each team and project and “group” each system was built for. I haven’t given this as much thought as it’s not directly related to what my team uses/needs.
Other ideas?