# Are there any modules that user need to interact with command-line interfaces which require user input

**URL:** <https://forum.ansible.com/t/are-there-any-modules-that-user-need-to-interact-with-command-line-interfaces-which-require-user-input/2436>\
**Category:** Get Help\
**Created:** [November 17, 2023, 8:37am UTC](https://forum.ansible.com/t/are-there-any-modules-that-user-need-to-interact-with-command-line-interfaces-which-require-user-input/2436 "2023-11-17T08:37:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanhnguyen](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@lanhnguyen](https://forum.ansible.com/u/lanhnguyen)\
**Post date:** [November 17, 2023, 8:37am UTC](https://forum.ansible.com/t/are-there-any-modules-that-user-need-to-interact-with-command-line-interfaces-which-require-user-input/2436/1 "2023-11-17T08:37:39Z")

</div>

Are there any modules that user need to interact with command-line interfaces which require user input, for example when we run the command mysql\_secure\_installation the user need to enter password… and something like that

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [November 17, 2023, 10:31am UTC](https://forum.ansible.com/t/are-there-any-modules-that-user-need-to-interact-with-command-line-interfaces-which-require-user-input/2436/2 "2023-11-17T10:31:33Z")

</div>

You can prompt for variables at the start, see the [Interactive input: prompts](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_prompts.html) documentation.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 17, 2023, 10:40am UTC](https://forum.ansible.com/t/are-there-any-modules-that-user-need-to-interact-with-command-line-interfaces-which-require-user-input/2436/3 "2023-11-17T10:40:34Z")

</div>

I think the question is more about how to run commands that prompt for user input. The default tool for these is the [ansible.builtin.expect module](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/expect_module.html), which is similar to the `expect` command line tool. (You need to install [pexpect](https://pypi.org/project/pexpect/) on the managed node to be able to use `ansible.builtin.expect`.)

---

<div class="post-metadata">

**Author:** ![jrglynn2](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jrglynn2](https://forum.ansible.com/u/jrglynn2)\
**Post date:** [November 17, 2023, 2:17pm UTC](https://forum.ansible.com/t/are-there-any-modules-that-user-need-to-interact-with-command-line-interfaces-which-require-user-input/2436/4 "2023-11-17T14:17:43Z")

</div>

To be clear, you don’t **need** to require user input. You can do some sort of lookup to (Ansible Vault / AWS Secrets / some other secure password storage) instead, if you want.
