# Handling prompts and drop-downs via ansible 2.9

**URL:** <https://forum.ansible.com/t/handling-prompts-and-drop-downs-via-ansible-2-9/33259>\
**Category:** Ansible Project\
**Created:** [June 25, 2020, 8:16am UTC](https://forum.ansible.com/t/handling-prompts-and-drop-downs-via-ansible-2-9/33259 "2020-06-25T08:16:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nishant\_Passari](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@Nishant\_Passari](https://forum.ansible.com/u/Nishant_Passari)\
**Post date:** [June 25, 2020, 8:16am UTC](https://forum.ansible.com/t/handling-prompts-and-drop-downs-via-ansible-2-9/33259/1 "2020-06-25T08:16:20Z")

</div>

Hi everyone,

Am trying to install jenkins-x version 2.0.785 via ansible 2.9.9.

How do I handle the prompts like “Please enter the name you wish to use with git:” that I get while installing jenkins-x? I get the prompt even though “–git-username=automation” is already passed in the JX install command. I tried with both expect and shell module in ansible.

There are also yes/no prompts to be handled that I will get further.

Regards,  
Nishant Passari

---

<div class="post-metadata">

**Author:** ![Luca\_remix\_tj\_Lorenz](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@Luca\_remix\_tj\_Lorenz](https://forum.ansible.com/u/Luca_remix_tj_Lorenz)\
**Post date:** [June 25, 2020, 8:18am UTC](https://forum.ansible.com/t/handling-prompts-and-drop-downs-via-ansible-2-9/33259/2 "2020-06-25T08:18:28Z")

</div>

Hello,

if you aren't able to automate with silent install, use the expect module.

Luca

---

<div class="post-metadata">

**Author:** ![Nishant\_Passari](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@Nishant\_Passari](https://forum.ansible.com/u/Nishant_Passari)\
**Post date:** [June 25, 2020, 10:05am UTC](https://forum.ansible.com/t/handling-prompts-and-drop-downs-via-ansible-2-9/33259/3 "2020-06-25T10:05:20Z")

</div>

Already tried with expect and shell module.

```auto

- name: Handling multiple prompts
expect:
command: jx install --git-provider-kind bitbucketserver --git-provider-url http://xyz-abc-git.net.local --git-username automation --default-environment-prefix Testproject --git-api-token MzI1ODg1NjA1NTk4OqjiP9N3lr4iHt9L5rofdaWMqsW --on-premise --external-ip {{ hostvars[groups["kubemaster"][0]]["ip"] }} --verbose --static-jenkins=true --provider=openshift
responses:
Question:
- Please enter the name you wish to use with git: automation
timeout: 60

```

```auto

- name: Handling prompts
expect:
command: jx install --git-provider-kind bitbucketserver --git-provider-url http://abc-xyz-git.net.local --git-username automation --default-environment-prefix Testproject --git-api-token MzI1ODg1NjA1NTk4OqjiP9N3lr4iHt9L5rofdaWMqsW --on-premise --external-ip {{ hostvars[groups["kubemaster"][0]]["ip"] }} --verbose --static-jenkins=true --provider=openshift
responses:
Please enter the name you wish to use with git: "automation"

```
