I have the following that work in CLI (both formats) and I am trying to figure out how to pass these extra-vars via the tower API. I’ve created a survey with a variable called ports. I’ve tried type “text” and “multi-text”.
ansible-playbook interface_config_bulk.yml -e ‘{“ports”:[ { “switch_name”:“burnside-lab-sw2”, “switch_port”:“Gi1/0/5” },{“switch_name”:“burnside-poc-sw8”,“switch_port”:“Gi1/0/2”}]}’
&
ansible-playbook interface_config_bulk.yml -e ‘{"ports":[ { "switch_name":"burnside-lab-sw2", "switch_port":"Gi1/0/5" },{"switch_name":"burnside-poc-sw8","switch_port":"Gi1/0/2"}]}’
In Tower API,
I’ve tried the following ‘Content’:
{
“extra_vars”:{“ports”:[ { “switch_name”:“burnside-lab-sw2”, “switch_port”:“Gi1/0/5” },{“switch_name”:“burnside-poc-sw8”,“switch_port”:“Gi1/0/2”}]}
}
but get an error:
“variables_needed_to_start”: [ “Value [OrderedDict([(‘switch_name’, ‘burnside-lab-sw2’), (‘switch_port’, ‘Gi1/0/5’)]), OrderedDict([(‘switch_name’, ‘burnside-poc-sw8’), (‘switch_port’, ‘Gi1/0/2’)])] for ‘ports’ expected to be a string.”
How do I do this via the Tower API?
Thanks