shadowman-lab / Ansible-Config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible-Config/SNOW/readme.md should note that extra variable cannot be passed unless the template requires it.

majormer opened this issue · comments

https://github.com/shadowman-lab/Ansible-Config/tree/main/SNOW#servicenowaap-integration-instructions-using-ansible-spoke

THANK YOU for this EXCELLENT GUIDE!

At Step 15, you show what the JSON should look like for extra_vars. However, if someone is following along in the video or reading the documentation, they might find that their extra variables are not being passed along. (happened to me) In my case, I spent 3 hours trying to make sure my JSON was right.

In this case, the following document notes the requirements:

https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.4/html-single/automation_controller_user_guide/index

20.13. Extra variables
When you pass survey variables, they are passed as extra variables (extra_vars) within automation controller. However, passing extra variables to a job template (as you would do with a survey) can override other variables being passed from the inventory and project.

Note
extra_vars passed to the job launch API are only honored if one of the following is true:

They correspond to variables in an enabled survey.
ask_variables_on_launch is set to True.

Ideally this is called out in the documentation (probably too late to call out on the video)

This would help people that are new to working with the API trying to use the ServiceNow integration with the Ansible Spoke

Updated the readme to include a note about ensuring either Prompt on Launch is checked or that the correspond to variables in an enabled survey in order for controller to receive the extra variables