ansible_become_pass

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

Try ansible_become_password

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html

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
docs.ansible.com

](https://docs.ansible.com/ansible/latest/network/getting_started/first_inventory.html)
(attachments)