Automating ansible from git

We are wanting to have ansible auto download from git, and then run to apply any changes to several hosts. The hosts will mostly be a dynamic inventory, but some will be static.

I’m just wondering, is this what Ansible AWX is designed for? We don’t really need a UI. So happy to just do this on linux too. Although if this is what AWX is designed for maybe it makes sense for us to use it. So the workflow would be like:

change in git to playbook/ansible code → syncs to linux ansible server (maybe every 5 minutes) → runs playbook against several hosts in a dynamic or static inventory on an interval. (For example every 30 minutes)

We are also wanting to execute runs on hosts after they have been provisioned by terraform. Any advice would be greatly appreciated.

AWX does that very nicely and you could create a workflow that runs the project sync before it runs the job templates.

You can accomplish this from the command line as well by running your playbooks from the cloned git directory so you don’t really have to install AWX if you don’t want to buy it sure is nice for orchestrating workflows and many other nice features. AWX also does a great job of scheduling jobs.

Running every 30 minutes seems excessive.

There are options for TF and ansible as well. Just do some searching and find a method that fits your use case best. Then if you have specific questions ask again.