Ansible Automation Platform (Tower) API: How to access payload from job launch POST request

72 Views Asked by At

I have an Ansible Automation Platform server and I want to launch a job template via webhook from my Bitbucket server. I'm aware that job templates have a webhook setting, but they currently only support Github or Gitlab. Despite this, I enabled webhooks on the job and tried configuring the webhook URL & secret in Bitbucket to the URL/Key provided on the job, but the connection failed.

As a workaround, I configured the webhook URL on Bitbucket as https://<ansible host>/api/v2/job_templates/<id>/launch and it's able to launch the job anytime the webhook fires.

My question is, how do I access the payload that is included in the POST request that Bitbucket sends to Ansible? I'm obviously not able to make Bitbucket include that data under extra_vars in the payload, so is there an automatic variable or some other way to access the payload that Bitbucket is providing?

0

There are 0 best solutions below