# Create survey for variable

**URL:** <https://forum.ansible.com/t/create-survey-for-variable/2047>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [October 31, 2023, 8:28am UTC](https://forum.ansible.com/t/create-survey-for-variable/2047 "2023-10-31T08:28:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimjith](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rimjith](https://forum.ansible.com/u/rimjith)\
**Post date:** [October 31, 2023, 8:28am UTC](https://forum.ansible.com/t/create-survey-for-variable/2047/1 "2023-10-31T08:28:09Z")

</div>

Hi All,  
I am trying to move this code to Ansible Tower, but I am not able to figure out how to create **survey** for hostName variable. Can anyone help me on this

```auto
- hosts: all
  gather_facts: no
  become: yes
  vars:
          hostName:
            - { servername : xxxx , esxi_ip : xxxx , ilo_ip : xxxx }
            - { servername : xxxx , esxi_ip : xxxx , ilo_ip : xxxx }
            - { servername : xxxx , esxi_ip : xxxx , ilo_ip : xxxx }

          ansible_python_interpreter: /usr/bin/python3
  tasks:
  - name: Create destination directory
    ansible.builtin.file:
      path: "{{ file_path }}/{{ item.servername }}"
      state: directory
      group: root
      mode: '0755'    
    loop: "{{ hostName }}"

```

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [November 1, 2023, 2:40pm UTC](https://forum.ansible.com/t/create-survey-for-variable/2047/2 "2023-11-01T14:40:05Z")

</div>

Make it a `textarea` with an appropriate default answer in `yaml` or `json` format. Then in your playbook use the “`ansible.builtin.from_yaml`” or" `ansible.builtin.from_json`" filter to re-ingest the text into a new variable.

(“`hostName`” isn’t a good long-term variable name. Upper-case letters ‘n’ such. “`ansible-lint`” is your friend.)
