# ansible\_become\_pass

**URL:** <https://forum.ansible.com/t/ansible-become-pass/38052>\
**Category:** Ansible Project\
**Created:** [June 2, 2023, 2:49pm UTC](https://forum.ansible.com/t/ansible-become-pass/38052 "2023-06-02T14:49:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [June 2, 2023, 2:49pm UTC](https://forum.ansible.com/t/ansible-become-pass/38052/1 "2023-06-02T14:49:10Z")

</div>

I am trying to run a pb that requires me to enter vault credentials as well as specifying -k  
for the become pass

Is there a way to put the become pass (root) in my vault file?

in my host file I have

[esxi]  
hostname ansible\_ssh\_user=root ansible\_become\_pass=‘{{ esxi\_root\_pass }}’

in my vault cred file

I have

esxi\_root\_pass: xxxxxx

but when i run pb

ansible-playbook -i hosts pb.yml --ask-vault-pass -vvv

I enter my vault pass but i cannot autenticate into the esxi host

but if I use -k

I get prompted for ssh pass and vault pass

then it works this way

---

<div class="post-metadata">

**Author:** ![Andrew\_Latham](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Andrew\_Latham](https://forum.ansible.com/u/Andrew_Latham)\
**Post date:** [June 2, 2023, 2:57pm UTC](https://forum.ansible.com/t/ansible-become-pass/38052/2 "2023-06-02T14:57:36Z")

</div>

Try ansible\_become\_password

[https://docs.ansible.com/ansible/latest/playbook\_guide/playbooks\_privilege\_escalation.html](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html)

---

<div class="post-metadata">

**Author:** ![Kosala\_Atapattu1](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@Kosala\_Atapattu1](https://forum.ansible.com/u/Kosala_Atapattu1)\
**Post date:** [June 2, 2023, 8:19pm UTC](https://forum.ansible.com/t/ansible-become-pass/38052/3 "2023-06-02T20:19:13Z")

</div>

In this context your esxi\_root\_password is not the become password isn’t it? You directly connect via root, not trying to become root after connecting via another user.

I think you should use ansible\_password instead.

Examples are here.

[

| 

[Build Your Inventory — Ansible Documentation](https://docs.ansible.com/ansible/latest/network/getting_started/first_inventory.html)  
[docs.ansible.com](https://docs.ansible.com/ansible/latest/network/getting_started/first_inventory.html)

 | 

 |

](https://docs.ansible.com/ansible/latest/network/getting\_started/first\_inventory.html)

> **(attachments)**
>
> ![Ansible-Mark-RGB_Black.png](https://us1.discourse-cdn.com/ansible/original/2X/c/c5c8b4ccf7b7fd7dde95e1a012a849821bf1ecfe.png)
