AWX Launch Template REST API ( extra_vars ) param not working

219 views
Skip to first unread message

RAHUL ANAND SAHU

unread,
May 22, 2023, 5:34:26 AM5/22/23
to AWX Project
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/ ]

Screenshot 2023-05-22 at 3.02.22 PM.png

akira 6592

unread,
May 23, 2023, 8:46:13 PM5/23/23
to AWX Project
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:

AWX Project

unread,
May 24, 2023, 2:53:44 PM5/24/23
to AWX Project
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
Reply all
Reply to author
Forward
0 new messages