# Without sudo, is it possible to manage multiple become users with distinct passwords?

**URL:** <https://forum.ansible.com/t/without-sudo-is-it-possible-to-manage-multiple-become-users-with-distinct-passwords/23679>\
**Category:** Ansible Project\
**Created:** [February 8, 2017, 4:10am UTC](https://forum.ansible.com/t/without-sudo-is-it-possible-to-manage-multiple-become-users-with-distinct-passwords/23679 "2017-02-08T04:10:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ednotover](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@ednotover](https://forum.ansible.com/u/ednotover)\
**Post date:** [February 8, 2017, 4:10am UTC](https://forum.ansible.com/t/without-sudo-is-it-possible-to-manage-multiple-become-users-with-distinct-passwords/23679/1 "2017-02-08T04:10:33Z")

</div>

Apologies in advance if this issue has been answered already. My searches came up empty.

I have a playbook that uses multiple become users on each host. I’d like to have the playbook work with whatever become method the caller wants to use. I know the caller can use connection variables to define per-host become passwords, but is it possible to have passwords defined on a per-host/per-user basis?

Thanks,  
Ed

[centos@testing ~]$ cat two\_be.yml

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [February 9, 2017, 6:02pm UTC](https://forum.ansible.com/t/without-sudo-is-it-possible-to-manage-multiple-become-users-with-distinct-passwords/23679/2 "2017-02-09T18:02:01Z")

</div>

I think you could set a become\_password at this point.  
become\_password: foobar

Instead of using cleartext it might be better to have this in the  
host\_vars (maybe encrypted with ansible-vault) and just use the  
variable here:

In the file host\_vars/host\_foo/some.yml:  
become\_password\_for\_user\_xyz: secret

And then use "become\_password: {{ become\_password\_for\_user\_xyz }}" in  
your playbook.

Untested.

Johannes
