need assistance with this playbook

28 views
Skip to first unread message

Tony Wong

unread,
Apr 14, 2020, 9:28:33 AM4/14/20
to Ansible Project
how do i create a ansible vmware playbook with following


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



Jorge Rúa

unread,
Apr 14, 2020, 9:41:59 AM4/14/20
to ansible...@googlegroups.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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f2c4baa1-fa5f-4895-a67e-3d95c318a89e%40googlegroups.com.

David Foley

unread,
Apr 14, 2020, 11:30:09 AM4/14/20
to Ansible Project
Hi Tony:

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

Tony Wong

unread,
Apr 14, 2020, 11:44:13 AM4/14/20
to ansible...@googlegroups.com
Hi

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

---
# Add a ESXi Host to a Datacenter using the 'vmware_host' module
- name: Join ESXi host to AD
  vmware_host_active_directory:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    esxi_hostname: '{{ esxi_hostname }}'
    ad_domain: domain.com
    ad_username: us...@domain.com
    ad_password: xxxxxx
    ad_state: present
    validate_certs: no
  delegate_to: localhost

- name: Set NTP servers for an ESXi Host
  vmware_host_ntp:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    esxi_hostname: '{{ esxi_hostname }}'
    state: present
    ntp_servers:
        - 0.pool.ntp.org
        - 1.pool.ntp.org
  delegate_to: localhost

- name: Manage multiple settings for an ESXi host
  vmware_host_config_manager:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    esxi_hostname: '{{ esxi_hostname }}'
    options:
        'VMkernel.Boot.hyperthreadingMitigation': true
  delegate_to: localhost



when i run my playbook it gives this




--
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 ansible-proje...@googlegroups.com.
Screen Shot 2020-04-14 at 8.43.29 AM.png

Abhijeet Kasurde

unread,
Apr 14, 2020, 11:50:28 AM4/14/20
to ansible...@googlegroups.com
vmware_host_active_directory does not have a parameter called 'ad_username' its actually 'ad_user'



--
Thanks,
Abhijeet Kasurde

Tony Wong

unread,
Apr 14, 2020, 12:06:57 PM4/14/20
to Ansible Project
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

 

Abhijeet Kasurde

unread,
Apr 14, 2020, 12:20:14 PM4/14/20
to ansible...@googlegroups.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 ansible-proje...@googlegroups.com.


--
Thanks,
Abhijeet Kasurde
Reply all
Reply to author
Forward
0 new messages