Bootstrap FreeKB - Ansible - Prompt for user input using Surveys in Tower
Ansible - Prompt for user input using Surveys in Tower

Updated:   |  Ansible articles

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"
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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