# combining lookups with prompts to provide choice lists for ansible vars

**URL:** <https://forum.ansible.com/t/combining-lookups-with-prompts-to-provide-choice-lists-for-ansible-vars/24195>\
**Category:** Ansible Project\
**Created:** [April 11, 2017, 10:52pm UTC](https://forum.ansible.com/t/combining-lookups-with-prompts-to-provide-choice-lists-for-ansible-vars/24195 "2017-04-11T22:52:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Ratcliffe](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@Chris\_Ratcliffe](https://forum.ansible.com/u/Chris_Ratcliffe)\
**Post date:** [April 11, 2017, 10:52pm UTC](https://forum.ansible.com/t/combining-lookups-with-prompts-to-provide-choice-lists-for-ansible-vars/24195/1 "2017-04-11T22:52:57Z")

</div>

Hello,

I am looking for a way to leverage Ansible Prompts directives to include choice lists, or even just to include a dynamic prompt based on the results of a url lookup.

This didn’t work:

- hosts: all  
vars:  
directions: “North, South, East West”

vars\_prompt:

- name: “choice”  
prompt: “Pick a direction: {{ directions }}”

tasks:

- debug: msg=" directions = {{ directions }} choice = {{ choice }}"

The prompt doesn’t replace the directions variable.

And this doesn’t seem to work either:

- hosts: all  
vars:  
dir: “{{ lookup(‘pipe’, ‘./getDirFromUser.sh’) }}”

tasks:

- debug: msg=" dir = {{ dir}} "

where the getDirFromuser.sh script would prompt for the direction.

Any thoughts on how I might be able to accomplish this?
