The vmware_datacenter module

A VMware vSphere data center is the name given to the collection of physical resources, hosts, storage, and networking which power your cluster:

- name: Create a datacenter  vmware_datacenter:    hostname: "{{ item.ip }}"    username: "{{ item.username }}"    password: "{{ item.password }}"    datacenter_name: "my_datacenter"    state: present  with_items: "{{ vsphere_hosts }}"

The previous example adds the hosts listed in vsphere_hosts to the my_datacenter VMware vSphere data center.

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.