# need assistance with this playbook

**URL:** <https://forum.ansible.com/t/need-assistance-with-this-playbook/32676>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [April 14, 2020, 1:28pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676 "2020-04-14T13:28:33Z")\
**Posts on this page:** 7\
**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:** [April 14, 2020, 1:28pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676/1 "2020-04-14T13:28:33Z")

</div>

how do i create a ansible vmware playbook with following

- join esx host to domain
- setup ntp with - [0.pool.ntp.org](http://0.pool.ntp.org), [1.pool.ntp.org](http://1.pool.ntp.org)
- set advance settings on host : VMkernel.Boot.hyperthreadingMitigation to True
- reboot host

---

<div class="post-metadata">

**Author:** ![Jorge\_Rua1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Jorge\_Rua1](https://forum.ansible.com/u/Jorge_Rua1)\
**Post date:** [April 14, 2020, 1:39pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676/2 "2020-04-14T13:39:35Z")

</div>

Have a look here [https://github.com/veksh/ansible-esxi](https://github.com/veksh/ansible-esxi)

---

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [April 14, 2020, 3:30pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676/3 "2020-04-14T15:30:09Z")

</div>

Hi Tony:

I think you need to look at powercli for ESXi Configuration:

---

<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:** [April 14, 2020, 3:43pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676/4 "2020-04-14T15:43:41Z")

</div>

Hi

Am I not allowed to have multiple modules in same yml file?

> **(attachments)**
>
> ![Screen Shot 2020-04-14 at 8.43.29 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/b/bc776cec6359523addb12618d2585a3f098d1bb3.png)

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [April 14, 2020, 3:49pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676/5 "2020-04-14T15:49:37Z")

</div>

vmware\_host\_active\_directory does not have a parameter called ‘ad\_username’ its actually ‘ad\_user’

---

<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:** [April 14, 2020, 4:06pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676/6 "2020-04-14T16:06:56Z")

</div>

> Thanks

I corrected it and now it looks like its trying to ssh into the host as my username which does not exist on the esxi host. How do I impersonate ssh into the host as root?

 ![Screen Shot 2020-04-14 at 9.06.37 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/e/efd7492707fea162069a63b16872215aa2a0f2da.png)

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [April 14, 2020, 4:19pm UTC](https://forum.ansible.com/t/need-assistance-with-this-playbook/32676/7 "2020-04-14T16:19:11Z")

</div>

Use `become`, you can read more here - [https://docs.ansible.com/ansible/latest/user\_guide/become.html](https://docs.ansible.com/ansible/latest/user_guide/become.html)

> **(attachments)**
>
> ![Screen Shot 2020-04-14 at 9.06.37 AM.png](https://us1.discourse-cdn.com/ansible/original/2X/e/efd7492707fea162069a63b16872215aa2a0f2da.png)
