# Programable Survey feature in AWX

**URL:** <https://forum.ansible.com/t/programable-survey-feature-in-awx/5806>\
**Category:** Project Discussions\
**Tags:** netbox, awx\
**Created:** [May 14, 2024, 2:22pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806 "2024-05-14T14:22:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [May 14, 2024, 2:22pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/1 "2024-05-14T14:22:15Z")

</div>

> <https://github.com/ansible/awx/issues/20>
>
> AWX Feature Spec - Programmable Surveys
> =======================================…
> 
> User Persona
> \------------
> Administrator delegating jobs to user
> Delegated automation user
> 
> Usage Cases
> \-----------
> High-level:
> 
> \* Administrator wants to present to the user a list of builds to choose to deploy.
> \* Administrator wants to present to the user a verified list of configuration parameters to push to the chosen network devices.
> \* Adminsitrator wants to present survey chocies that depend on prior survey choices, such as a choice to select an AWS region based on 'AWS' being a prior survey answer.
> 
> API Considerations
> \------------------
> We must keep the survey JSON specification stable, or CLEARLY notify users when it changes. This may require a v2 survey spec.
> 
> http://json-schema.org/ may be of use.
> 
> UI/UX Considerations
> \--------------------
> Larger surveys should have options to collapse questions until needed. (c.f. https://github.com/ansible/awx/issues/290)
> 
> Docs
> \----
> Should have sample survey examples
> 
> QA Suggestions
> \--------------
> 
> Notes
> \-----
> 
> Updates/Changelog
> \-----------------
> 2017-09-06: initial/updated spec
> 2017-09-25: added note about collapsible surveys

This is one of the must thumbs up and frequently requested feature in the AWX project and recently when I attended Ansible Fest 2024 6 people came up to me and ask me about this feature.

At this point I do not know what is involve in implementing this feature but lets design it together!

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [May 14, 2024, 2:23pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/2 "2024-05-14T14:23:29Z")

</div>

> **[AnsibleForms Docs - Introduction](https://ansibleforms.com/introduction/)**
>
> Ansible is a great automation tool, but in the end, it's still a command-line application.  
> While AWX/Tower is a great GUI, it is lacking fancy forms that can grab data from several sources.\<br\>\<br\>  
>   
> That's where AnsibleForms comes in. It...

this is something someone at Fest brought up to me for what they use as a workaround to AWX not having fancy forms

I have not used it yet, maybe there’s something we can learn about from this project

Open Source++

---

<div class="post-metadata">

**Author:** ![fvzwieten](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/fvzwieten/32/3445_2.png) [@fvzwieten](https://forum.ansible.com/u/fvzwieten)\
**Post date:** [May 14, 2024, 3:03pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/3 "2024-05-14T15:03:00Z")

</div>

We allow the user to fill in a URL in the Multiple-Choice answer types as a single option. The file will be fetched before building the UI for the survey and will populate the multiple choices. If there is a problem with the file the field should be the provided default or blank if there is none.

---

<div class="post-metadata">

**Author:** ![tanganellilore](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tanganellilore/32/178_2.png) [@tanganellilore](https://forum.ansible.com/u/tanganellilore)\
**Post date:** [May 14, 2024, 3:10pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/4 "2024-05-14T15:10:39Z")

</div>

Just one workaround solution:

Ansible forms: [https://ansibleforms.com/](https://ansibleforms.com/)  
😄

---

<div class="post-metadata">

**Author:** ![thedoubl3j](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thedoubl3j/32/103_2.png) [@thedoubl3j](https://forum.ansible.com/u/thedoubl3j)\
**Post date:** [May 14, 2024, 3:13pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/5 "2024-05-14T15:13:58Z")

</div>

have you all used it @tanganellilore?

we are looking at it now in the meeting.

---

<div class="post-metadata">

**Author:** ![djdanielsson](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/djdanielsson/32/566_2.png) [@djdanielsson](https://forum.ansible.com/u/djdanielsson)\
**Post date:** [May 14, 2024, 4:09pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/6 "2024-05-14T16:09:24Z")

</div>

one issue I could see with ansibleforms is currently I know many people use surveys to pass passwords into the automation and it would show in plain text if sent from the API as extra vars vs how the survey password option currently somewhat obfuscates the passwords at least if not securely manage it similar to credentials.

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [May 14, 2024, 4:15pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/7 "2024-05-14T16:15:08Z")

</div>

during today (May 14) community meeting @AlanCoding mention we want to add something around encrypted extra\_vars to signal that encrypt it in database and do not show it on API [[tech debt] Remove the `survey_passwords` field by AlanCoding · Pull Request #13091 · ansible/awx · GitHub](https://github.com/ansible/awx/pull/13091) this is the PR that he referenced

---

<div class="post-metadata">

**Author:** ![MalfuncEddie](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/malfunceddie/32/428_2.png) [@MalfuncEddie](https://forum.ansible.com/u/MalfuncEddie)\
**Post date:** [May 17, 2024, 5:40pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/8 "2024-05-17T17:40:29Z")

</div>

> [@TheRealHaoLiu](#):
>
> is is one of the must thumbs up and frequently requested feature in the AWX project and recently when I attended Ansible Fest 2024 6 people came up to me and ask me about this feature.
> 
> At this point I do not know what is involve in implementing this feature but

I am struggling with ansible forms specifically with passwords. Since they are clear text in the api and a survey does “$encrypted$”

But other than that ansible forms is awsome! The feature to query a rest api (netbox in my case) changes AWX into datacenter wizard tool.

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [May 29, 2024, 2:19pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/9 "2024-05-29T14:19:26Z")

</div>

@tanganellilore would u be able to demo ansibleform on our next community meeting?

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [May 29, 2024, 2:20pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/10 "2024-05-29T14:20:50Z")

</div>

this is something we talked about on our last community meeting see my comment [Programable Survey feature in AWX - #7 by TheRealHaoLiu](http://forum.ansible.com/t/programable-survey-feature-in-awx/5806/7)

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [May 29, 2024, 2:21pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/11 "2024-05-29T14:21:33Z")

</div>

as for “query generic rest api to get options” is this something ansibleform able to do?

---

<div class="post-metadata">

**Author:** ![tanganellilore](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tanganellilore/32/178_2.png) [@tanganellilore](https://forum.ansible.com/u/tanganellilore)\
**Post date:** [May 29, 2024, 2:26pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/12 "2024-05-29T14:26:51Z")

</div>

Difficult to me because we are on new product launch in our company and we are very busy.

I will chato you if i can do it.

---

<div class="post-metadata">

**Author:** ![MalfuncEddie](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/malfunceddie/32/428_2.png) [@MalfuncEddie](https://forum.ansible.com/u/MalfuncEddie)\
**Post date:** [May 29, 2024, 6:14pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/13 "2024-05-29T18:14:10Z")

</div>

> **[AnsibleForms Docs - Using expressions](https://ansibleforms.com/expressions/#rest-api-with-basic-authentication)**
>
> Make advanced forms with expressions

Yes  
this an example where I query netbox (ibm property now 😉 ) to select a tenant in a drop down.  
You can later use this in another rest api call

```
- name: Tenant
  type: enum
  expression:
    fn.fnRestJwtSecure('get','https://xxxx/api/tenancy/tenants/','','credential_name ','[.results[]]','','','Token'
    )
  columns:
    - name
  noOutput: false
  outputObject: true
  group: Vm Settings

```

some fields later

```auto
expression: fn.fnRestJwtSecure('get',
        'https://xxxx/api/ipam/prefixes?tenant_id=$(Tenant.id)

```

---

<div class="post-metadata">

**Author:** ![MalfuncEddie](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/malfunceddie/32/428_2.png) [@MalfuncEddie](https://forum.ansible.com/u/MalfuncEddie)\
**Post date:** [May 29, 2024, 7:03pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/14 "2024-05-29T19:03:54Z")

</div>

Maybe I am missing something but looking at the PR I think I stumbled on feature I did not know the existence of.

Am I correct that extra\_data is not shown in the logging and can be used for passwords?

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [May 29, 2024, 8:42pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/15 "2024-05-29T20:42:23Z")

</div>

Currently it doesn’t know and it will be logged and recorded in DB in plan text

---

<div class="post-metadata">

**Author:** ![nsavich](https://avatars.discourse-cdn.com/v4/letter/n/d78d45/32.png) [@nsavich](https://forum.ansible.com/u/nsavich)\
**Post date:** [July 22, 2024, 6:11pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/16 "2024-07-22T18:11:01Z")

</div>

Has anyone gotten AnsibleForms to work with AAP’s automation controller?

---

<div class="post-metadata">

**Author:** ![MalfuncEddie](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/malfunceddie/32/428_2.png) [@MalfuncEddie](https://forum.ansible.com/u/MalfuncEddie)\
**Post date:** [July 22, 2024, 6:43pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/17 "2024-07-22T18:43:14Z")

</div>

What is not working (I only have AWX) but it is just a form wizard create that sends an api launch request to AWX/AAP. So I don’t see why it should not work?

---

<div class="post-metadata">

**Author:** ![azrdev](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/azrdev/32/1491_2.png) [@azrdev](https://forum.ansible.com/u/azrdev)\
**Post date:** [October 2, 2024, 9:16am UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/18 "2024-10-02T09:16:27Z")

</div>

I have collected from #20 and linked issues what people want to do with surveys but cannot currently do:

- have single/multiple choice options with labels separate from the variable content
- have more flexible validation logic for stringly typed variables, e.g. regex\_match ([Feature request: additional survey validation · Issue #1108 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/1108))
- have single/multiple choice options depend on / be fetched from some external source (e.g. [how to add custom surveys using external apis? · Issue #436 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/436) & [RFE: Include dynamic entries in multi-choice survey drop-down menu · Issue #1346 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/1346) )
- have questions visibility/required-ness depend on answers to previous questions ([Templet UI survey expand/collapse section · Issue #290 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/290) & [Feature: Programmable surveys · Issue #20 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/20#issuecomment-1153200554))
- have question/answer visibility depend on user permissions ( [Permissions on Surveys for Different options between Teams/Roles · Issue #9209 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/9209))
- validate answers with information from external sources ( [Feature: Programmable surveys · Issue #20 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/20#issuecomment-1497890709) & [Retreive list of a repository tags to populate a multiple choice list in survey · Issue #6436 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/6436))
- have choice options depend on answers to previous questions ([Add the ability to generate dynamic options for survey multi-select fields. · Issue #363 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/363) & [UI survey answer types · Issue #355 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/355) & [Feature Request for awx survey - popup child variables depended on previous variables to improve UX · Issue #2053 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/2053) & [Feature: Programmable surveys · Issue #20 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/20#issuecomment-1152666735))
- update single questions via API instead of the whole survey json object
- pre-populate survey answers using e.g. a stored-answers file ([Prepopulate surveys with values from yaml / ini · Issue #859 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/859))
- retrieve previously data stored by an AWX job. ( [Feature: Programmable surveys · Issue #20 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/20#issuecomment-403726749) & [Feature: Programmable surveys · Issue #20 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/20#issuecomment-1517534647) (interactive selection of --limit) )
- template awx-available information like awx\_user, inventory reference, inventory hosts/groups (e.g. [Feature: Programmable surveys · Issue #20 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/20#issuecomment-434653628) & [Feature: Programmable surveys · Issue #20 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/20#issuecomment-655527575) & [Inventory Level Surveys · Issue #10882 · ansible/awx · GitHub](https://github.com/ansible/awx/issues/10882))

---

<div class="post-metadata">

**Author:** ![ansibleguy76](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ansibleguy76/32/5483_2.png) [@ansibleguy76](https://forum.ansible.com/u/ansibleguy76)\
**Post date:** [November 16, 2024, 12:20pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/19 "2024-11-16T12:20:27Z")

</div>

Hi, I’m the developer of AnsibleForms.  
What is your struggle with passwords ?

If you are using AWX, you can inject credentials from there.  
AnsibleForms can also inject credentials, but that feature was meant if you run ansible locally. Don’t have AnsibleForms inject credentials which will indeed be then sent as extravars to AWX. AnsibleForms allows you to dynamically add credentials in AWX, if that would be needed.

---

<div class="post-metadata">

**Author:** ![MalfuncEddie](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/malfunceddie/32/428_2.png) [@MalfuncEddie](https://forum.ansible.com/u/MalfuncEddie)\
**Post date:** [November 16, 2024, 6:31pm UTC](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806/20 "2024-11-16T18:31:35Z")

</div>

> If you are using AWX, you can inject credentials from there.

Yes but I don’t want the hassle of doing that.

> AnsibleForms can also inject credentials, but that feature was meant if you run ansible locally.  
> Don’t have AnsibleForms inject credentials which will indeed be then sent as extravars to AWX.

Yes because it will be logged in the api and such.

> AnsibleForms allows you to dynamically add credentials in AWX, if that would be needed.

Yeah but what if it is a credential that is personal to you? I don’t want the awx admin to be able to use my password, token … even if it is unknown and encrypted. It can be used in other playbooks by the admin.

The issue is that awx does not have a “sensitive extra vars”.

Use cases:  
I need to do some stuff with a named account, import a certificate or just some ad-hoc stuff where I don’t want the hassle of creating a credential first.

In terraform/tofu you can mark a variable sensitive and in all logging that variable is changed to " "

The funny part is that in the “AWX survey” you CAN mark a input field as “password”

> - _Password_: Responses are treated as sensitive information, much like an actual password is treated. You can set the minimum and maximum length (in characters) for this answer."

[https://docs.ansible.com/ansible-tower/latest/html/userguide/job\_templates.html](https://docs.ansible.com/ansible-tower/latest/html/userguide/job_templates.html)

I solved part of my problem of having ansible forms asking for a password ID and then use that in my playbook tot securely retrieve the password via an api call. But that is technical the same as just defining it in an awx credential0

And last but not least:

I \<3 ansible forms!

[Next page](https://forum.ansible.com/t/programable-survey-feature-in-awx/5806.md?page=2)
