# how do I properly set ANSIBLE\_BECOME\_PASS ?

**URL:** <https://forum.ansible.com/t/how-do-i-properly-set-ansible-become-pass/30232>\
**Category:** Ansible Project\
**Created:** [May 1, 2019, 6:55pm UTC](https://forum.ansible.com/t/how-do-i-properly-set-ansible-become-pass/30232 "2019-05-01T18:55:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [May 1, 2019, 6:55pm UTC](https://forum.ansible.com/t/how-do-i-properly-set-ansible-become-pass/30232/1 "2019-05-01T18:55:39Z")

</div>

Hello! Sorry to be so lame. What combination of environment vars do I need to set in order to not get prompted for a SUDO password?!

I’ve tried setting ANSIBLE\_BECOME\_PASS and ANSIBLE\_ASK\_BECOME\_PASS=False but I still get prompted . …

Thanks,  
Guy

---

<div class="post-metadata">

**Author:** ![cassell](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cassell](https://forum.ansible.com/u/cassell)\
**Post date:** [May 1, 2019, 7:06pm UTC](https://forum.ansible.com/t/how-do-i-properly-set-ansible-become-pass/30232/2 "2019-05-01T19:06:41Z")

</div>

> Hello! Sorry to be so lame. What combination of environment vars do I  
> need to set in order to not get prompted for a SUDO password?!
> 
> I've tried setting ANSIBLE\_BECOME\_PASS and ANSIBLE\_ASK\_BECOME\_PASS=False  
> but I still get prompted . ..

ansible-config dump --only-changed

---

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [May 1, 2019, 8:27pm UTC](https://forum.ansible.com/t/how-do-i-properly-set-ansible-become-pass/30232/3 "2019-05-01T20:27:33Z")

</div>

Thanks, but that didn’t exactly help. I’m not able to figure out what I’m missing . . . any other thoughts? Thanks again!!!  
here’s the output from ‘–only-changed’:

DEFAULT\_BECOME(/Users/matz/Code/schransible/ansible.cfg) = True  
DEFAULT\_VAULT\_PASSWORD\_FILE(/Users/matz/Code/schransible/ansible.cfg) = /Users/matz/.vault\_pw  
HOST\_KEY\_CHECKING(/Users/matz/Code/schransible/ansible.cfg) = False

---

<div class="post-metadata">

**Author:** ![cassell](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cassell](https://forum.ansible.com/u/cassell)\
**Post date:** [May 1, 2019, 9:04pm UTC](https://forum.ansible.com/t/how-do-i-properly-set-ansible-become-pass/30232/4 "2019-05-01T21:04:14Z")

</div>

> Thanks, but that didn't exactly help. I'm not able to figure out what I'm  
> missing . . . any other thoughts? Thanks again!!!  
> here's the output from '--only-changed':
> 
> DEFAULT\_BECOME(/Users/matz/Code/schransible/ansible.cfg) = True  
> DEFAULT\_VAULT\_PASSWORD\_FILE(/Users/matz/Code/schransible/ansible.cfg) =  
> /Users/matz/.vault\_pw  
> HOST\_KEY\_CHECKING(/Users/matz/Code/schransible/ansible.cfg) = False

There seems to be no environment variable for the become password. You can make your own, though:  
export ANSIBLE\_BECOME\_PASSWORD=mypassword

then in your ansible variables, set:  
ansible\_become\_password: "{{ lookup('env', 'ANSIBLE\_BECOME\_PASSWORD') }}"

V/r,  
James Cassell

---

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [May 2, 2019, 4:16pm UTC](https://forum.ansible.com/t/how-do-i-properly-set-ansible-become-pass/30232/5 "2019-05-02T16:16:25Z")

</div>

YAY!!
