# How to provide prompt inputs

**URL:** <https://forum.ansible.com/t/how-to-provide-prompt-inputs/26236>\
**Category:** Ansible Project\
**Created:** [December 9, 2017, 6:24am UTC](https://forum.ansible.com/t/how-to-provide-prompt-inputs/26236 "2017-12-09T06:24:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishal\_Bhargava](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@Vishal\_Bhargava](https://forum.ansible.com/u/Vishal_Bhargava)\
**Post date:** [December 9, 2017, 6:24am UTC](https://forum.ansible.com/t/how-to-provide-prompt-inputs/26236/1 "2017-12-09T06:24:13Z")

</div>

HI,

I am trying to write an ansible playbook which will run some command on a remote server, but the problem is when this command is run, it asks for user and password which I cannot provide from the command line. I am prompted to enter these values, any idea how this can be done with Ansible?

I looked at ansible prompts but how to pass those variables to prompt?

Any help is appreciated, thanks in advance.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 9, 2017, 9:53am UTC](https://forum.ansible.com/t/how-to-provide-prompt-inputs/26236/2 "2017-12-09T09:53:04Z")

</div>

To run commands interactively you need to use the expect module[1] to pass it values.  
It's not very well documented, but if you search the list you'll see how to use it.

[1] [https://docs.ansible.com/ansible/latest/expect\_module.html](https://docs.ansible.com/ansible/latest/expect_module.html)
