# need a playbook to change esxi root pass

**URL:** <https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097>\
**Category:** Ansible Project\
**Created:** [October 24, 2020, 3:28am UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097 "2020-10-24T03:28:52Z")\
**Posts on this page:** 8\
**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:** [October 24, 2020, 3:28am UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/1 "2020-10-24T03:28:52Z")

</div>

How do I change the root password on all esxi hosts with a pb?

---

<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:** [October 24, 2020, 1:53pm UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/2 "2020-10-24T13:53:40Z")

</div>

Need help on this please.

my inventory file

[esx]  
esx1  
esx2  
esx3

---

<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:** [October 25, 2020, 12:07am UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/3 "2020-10-25T00:07:11Z")

</div>

this is error I get now

The full traceback is:  
Traceback (most recent call last):  
File “/tmp/ansible\_community.vmware.vmware\_local\_user\_manager\_payload\_4mdm01xz/ansible\_community.vmware.vmware\_local\_user\_manager\_payload.zip/ansible\_collections/community/vmware/plugins/module\_utils/vmware.py”, line 25, in   
import requests  
ImportError: No module named ‘requests’  
fatal: [esxhost]: FAILED! =\> {  
“changed”: false,  
“invocation”: {  
“module\_args”: {  
“hostname”: “esxhost”,  
“local\_user\_description”: null,  
“local\_user\_name”: “root”,  
“local\_user\_password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“port”: 443,  
“proxy\_host”: null,  
“proxy\_port”: null,  
“state”: “present”,  
“username”: “root”,  
“validate\_certs”: false  
}  
},  
“msg”: “Failed to import the required Python library (requests) on esxhost s Python /usr/bin/python3. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible\_python\_interpreter”  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
esxhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

---

<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:** [October 25, 2020, 12:07am UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/4 "2020-10-25T00:07:54Z")

</div>

my playbook

---

<div class="post-metadata">

**Author:** ![vinod93pop](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@vinod93pop](https://forum.ansible.com/u/vinod93pop)\
**Post date:** [October 25, 2020, 2:54pm UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/5 "2020-10-25T14:54:36Z")

</div>

You need to have pip module to run in target hosts. You might have installed pip package on local host . You can simply run this on localhost . It will work . Make exsi hosts on loop

//Vinoth

---

<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:** [October 25, 2020, 4:50pm UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/6 "2020-10-25T16:50:58Z")

</div>

but I have all the pip /pip3 python packages installed already

there isnt anything I can install on a remote esxi host

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [October 25, 2020, 5:45pm UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/7 "2020-10-25T17:45:57Z")

</div>

I think you need to run this against localhost (i.e. the controlnode)  
as this is where you have pyvmomi installed.  
The ESXi host name should go as the argument in the task itself.

---

<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:** [October 26, 2020, 2:58pm UTC](https://forum.ansible.com/t/need-a-playbook-to-change-esxi-root-pass/34097/8 "2020-10-26T14:58:26Z")

</div>

yes! That did it. Thank you
