Elastic Alerting + Ansible Tower

Yeah, it looks like Ansible Tower does a good job making sure the "easy" webhook setup only works for Gitlab and Github.

That being said, a webhook is normally just a GET or POST request with a specific JSON body. With AWX/Tower you can launch a job by initiating a POST request to https://TOWERSERVER/api/v2/job_templates/{TEMPLATE_ID}/launch/?format=api with credentials.

I have not tested this so your mileage may vary but you may be able to setup the webhook pointed at your job template and it might just work. I believe the body of the request should appear as extra_vars for your job but you will want to review ansible tower API documentation to be sure.

Someone with access to modify the webhook url may be able to launch other job templates so keep this in mind as you think about the surface area between the two tools.

1 Like