# password prompting

**URL:** <https://forum.ansible.com/t/password-prompting/19276>\
**Category:** Ansible Developer\
**Created:** [September 16, 2015, 2:03pm UTC](https://forum.ansible.com/t/password-prompting/19276 "2015-09-16T14:03:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_Przytula](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Guy\_Przytula](https://forum.ansible.com/u/Guy_Przytula)\
**Post date:** [September 16, 2015, 2:03pm UTC](https://forum.ansible.com/t/password-prompting/19276/1 "2015-09-16T14:03:03Z")

</div>

using ansibe 1.4.3 on linux intel  
existing playbooks are available  
a new request for modification came in  
execute some shell command : export xx=yy;export cc=yy;cd /hhhh; ./dsmapiw  
this command will prompt for the password 3 times  
pw has been entered with vars\_prompt  
I could not find an easy way to reply to these prompts  
I have seen -expect but we migth not have this module  
any pointer to doc/page is welcome  
thanks for all update  
best regards, Guy Przytula

---

<div class="post-metadata">

**Author:** ![Conor\_Schaefer](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@Conor\_Schaefer](https://forum.ansible.com/u/Conor_Schaefer)\
**Post date:** [September 16, 2015, 2:30pm UTC](https://forum.ansible.com/t/password-prompting/19276/2 "2015-09-16T14:30:51Z")

</div>

Hey Guy,

First, I highly recommend you upgrade to a newer version of Ansible. Right now 1.9.3 is new, and it won’t be long until version 2.0 is released. See release notes here: [https://github.com/ansible/ansible/blob/devel/CHANGELOG.md](https://github.com/ansible/ansible/blob/devel/CHANGELOG.md)

Now, about your question: which password is anisble prompting for? It sounds like it’s the sudo password, in which case you can use the flag --ask-sudo-pass on the playbook run and type it only once. Don’t use vars\_prompt for a sudo password, since ansible already has functionality to handle it. There’s also --ask-pass for the SSH password, in case that’s what’s missing.

Last, you can run the ./dsmapiw command with custom environment variables by using the ‘environment’ keyword. See the examples here: [http://docs.ansible.com/ansible/playbooks\_environment.html](http://docs.ansible.com/ansible/playbooks_environment.html)

---

<div class="post-metadata">

**Author:** ![Guy\_Przytula](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Guy\_Przytula](https://forum.ansible.com/u/Guy_Przytula)\
**Post date:** [September 17, 2015, 9:37am UTC](https://forum.ansible.com/t/password-prompting/19276/3 "2015-09-17T09:37:00Z")

</div>

> thanks for the update

yes, we should plan to install a newer version  
the utility prompting for the pw is not for sudo or anything related to operating system  
it is a utility to generate a password for db2 to be used whenever accessing tsm (storage manager)  
the utility prompts for current password - new password and confirm new password  
we just do this the first time to generate the pwfile keeping this encrypted pw… and never be prompted again  
best regards, Guy Przytula
