I am trying to execute launch_template API through Python and send extra_vars as JSON payload as per API documentation. But extra_vars are not working and template execution gets failed.
AWX_API = “http://tul-itawxd-l01.tul.tivo.com:31709/api/v2/job_templates/15/launch/ ”
response = requests.post(AWX_API, json={“extra_vars”: payload},
auth=HTTPBasicAuth(‘USER’, ‘PASS’))
How can i resolve this ? I following official Ansible Tower docs to perform POST request for the REST API - [ /api/v2/job_templates/{id}/launch/ ]
akira6592
(Akira Yokochi)
May 24, 2023, 12:46am
2
Hello RAHUL ANAND SAHU
Cloud you try select “Prompt on launch” on job template?
2023年5月22日月曜日 18:34:26 UTC+9 RAHUL ANAND SAHU:
as mentioned above, make sure prompt on launch is enabled for extra variables on that job template
another thing to test, does it work if you add them directly to the extra variables form on the job template?
for more info about the “prompt on launch” option, check out this official documentation https://docs.ansible.com/automation-controller/latest/html/userguide/job_templates.html#create-a-job-template
AWX Team