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. 



Sent from my iPhone

On 3/06/2023, at 2:57 AM, Andrew Latham <[email protected]> wrote:


On Fri, Jun 2, 2023 at 8:49 AM Tony Wong <[email protected]> wrote:
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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/82daaf17-c8a0-4722-a3af-29d72963c4cfn%40googlegroups.com.


--
- Andrew "lathama" Latham -

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2Bqj4S8Q2rC2Su-AJK1coo-G15k%3Du5VCujqtLtyCK7ihVSa6jQ%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/B5DFD638-648E-4270-AB1F-D4A9C2C4C671%40gmail.com.

Reply via email to