Ansible - Prompt for user input using Surveys in Tower

Surveys are used to create a prompt for user input. 

  1. In the left panel of Ansible Tower, select Templates and then select a template you have created.
  2. 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"
}

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter 1de1a in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |