# Using playbook with multiple remote hosts and different password for each one

**URL:** <https://forum.ansible.com/t/using-playbook-with-multiple-remote-hosts-and-different-password-for-each-one/13283>\
**Category:** Ansible Project\
**Created:** [August 12, 2013, 3:36pm UTC](https://forum.ansible.com/t/using-playbook-with-multiple-remote-hosts-and-different-password-for-each-one/13283 "2013-08-12T15:36:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oded\_Ovdat](https://avatars.discourse-cdn.com/v4/letter/o/8e7dd6/32.png) [@Oded\_Ovdat](https://forum.ansible.com/u/Oded_Ovdat)\
**Post date:** [August 12, 2013, 3:36pm UTC](https://forum.ansible.com/t/using-playbook-with-multiple-remote-hosts-and-different-password-for-each-one/13283/1 "2013-08-12T15:36:54Z")

</div>

Hey,  
I am using the raw module to manage several remote hosts that cannot run python.  
my inventory file looks like this :

[devices]  
device1 ansible\_ssh\_host=127.0.0.1 ansible\_ssh\_port=30002 ansible\_ssh\_user=‘root’  
device2 ansible\_ssh\_host=127.0.0.1 ansible\_ssh\_port=30001 ansible\_ssh\_user=‘root’

Now I am running the same playbook on each one of the hosts  
each one of the hosts has a different password (I know I can add "ansible\_ssh\_password=‘password’ to the inventory but I prefer not to due to security reasons)  
when I run the playbook with -k I can only insert 1 password, is there a way to manually insert a different password for each hosts using only 1 command?

$ansible-playbook -k  
device1 password:  
device2 password:

thanks!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [August 12, 2013, 9:11pm UTC](https://forum.ansible.com/t/using-playbook-with-multiple-remote-hosts-and-different-password-for-each-one/13283/2 "2013-08-12T21:11:29Z")

</div>

Nope, there’s not.

You really should use keys or some sort of centralized identity management. Keys are friends! 🙂

–Michael
