Ansible - Prompt for user input using Surveys in Tower

by
Jeremy Canfield |
Updated: December 01 2021
| Ansible articles
Surveys are used to create a prompt for user input.
- In the left panel of Ansible Tower, select Templates and then select a template you have created.
- Select Add Survey or Edit Survey.
In this example, a survey is created that will prompt for a value that will be with the "foo" variable.
Then, when launching the job, there will be a prompt that will associate a value with the "foo" variable.
Let's say the job template is running the following playbook.
---
- hosts: all
tasks:
- debug:
msg: the 'foo' variable contains a value of {{ foo }}
...
AVOID TROUBLE
The Extra Variables in Tower and set_fact module will take precedence over the prompt.
Something like this should be returned.
TASK [debug]
ok: [localhost] => {
"msg": "the 'foo' variable contains a value of bar"
}
Did you find this article helpful?
If so, consider buying me a coffee over at