# Unable use expect module in ansible to respond multiple times to a question with different answers.

**URL:** <https://forum.ansible.com/t/unable-use-expect-module-in-ansible-to-respond-multiple-times-to-a-question-with-different-answers/30019>\
**Category:** Ansible Project\
**Created:** [March 29, 2019, 7:55am UTC](https://forum.ansible.com/t/unable-use-expect-module-in-ansible-to-respond-multiple-times-to-a-question-with-different-answers/30019 "2019-03-29T07:55:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barun\_kumar](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@Barun\_kumar](https://forum.ansible.com/u/Barun_kumar)\
**Post date:** [March 29, 2019, 7:55am UTC](https://forum.ansible.com/t/unable-use-expect-module-in-ansible-to-respond-multiple-times-to-a-question-with-different-answers/30019/1 "2019-03-29T07:55:43Z")

</div>

**Playbook -**

- name: starting splunk forwarder service  
expect:  
command: /opt/atlassian/bitbucket/atlassian-bitbucket-6.1.2-x64.bin  
responses:  
‘Install a new instance [1, Enter], Upgrade an existing instance [2]’: ‘1’  
‘Install a Server instance [1, Enter], Install a Data Center instance [2], Install a Smart Mirroring instance [3]’: ‘2’  
‘Select the folder where you would like Bitbucket 6.1.2 to be installed, then click Next.’: ‘/opt/atlassian/bitbucket/6.1.2’  
‘Ensure that this location is not used by another Bitbucket installation.’: ‘/var/atlassian/application-data/bitbucket’

**Error-**

TASK [starting splunk forwarder service] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [10.0.11.31]: FAILED! =\> {“changed”: true, “cmd”: “/opt/atlassian/bitbucket/atlassian-bitbucket-6.1.2-x64.bin”, “delta”: “0:00:30.132752”, “end”: “2019-03-29 07:53:36.157197”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-03-29 07:53:06.024445”, “stdout”: “Starting Installer …\r\n\u001b[?7h\r\nBitbucket 6.1.2 installation wizard\r\nWould you like to install or upgrade an instance?\r\nInstall a new instance [1, Enter], Upgrade an existing instance [2]”, “stdout\_lines”: [“Starting Installer …”, “\u001b[?7h”, “Bitbucket 6.1.2 installation wizard”, “Would you like to install or upgrade an instance?”, “Install a new instance [1, Enter], Upgrade an existing instance [2]”]}  
to retry, use: --limit @/infra\_code/update-bitbucket.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Any support much appreciated.
