Hi Tony,
Looking at the Documentation
https://docs.ansible.com/ansible/latest/modules/vmware_host_module.html
- name: Add ESXi Host to vCenter
vmware_host:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: datacenter_name
cluster: cluster_name
esxi_hostname: '{{ esxi_hostname }}'
esxi_username: '{{ esxi_username }}'
esxi_password: '{{ esxi_password }}'
state: present
delegate_to: localhost
This code will add the host to a Cluster,
On Monday, April 13, 2020 at 4:48:40 PM UTC+1, Tony Wong wrote:
>
> I am new to ansible and want to know how to add a esxi host to vcenter in
> a datacenter
>
> I have the following in a yml file but not sure what else to do
>
>
> - hosts: localhost
> connection: local
> tasks:
> - name: include vars
> include_vars:
>
> - name: Add ESXi Host to vCenter
> vmware_host:
> hostname: '{{ vcenter_hostname }}'
> username: '{{ vcenter_username }}'
> password: '{{ vcenter_password }}'
> datacenter: datacenter_name
> esxi_hostname: '{{ esxi_hostname }}'
> esxi_username: '{{ esxi_username }}'
> esxi_password: '{{ esxi_password }}'
> state: present
> delegate_to: localhost
> ~
>
>
>
>
> please help as vmware ansible seems very limited in info
>
--
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/7d76788c-cc3f-4530-80cd-626b4700cf1c%40googlegroups.com.