vmware.vmware.cluster_info module – Gathers information about one or more clusters
Note
This module is part of the vmware.vmware collection (version 1.7.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install vmware.vmware
.
To use it in a playbook, specify: vmware.vmware.cluster_info
.
Synopsis
Gathers information about one or more clusters. You can search for clusters based on the cluster name, datacenter name, or a combination of the two.
Parameters
Parameter |
Comments |
---|---|
The name of the cluster on which to gather info. At least one of |
|
The name of the datacenter. At least one of |
|
If true, gather any tags attached to the cluster(s) This has no affect if the Choices:
|
|
The hostname or IP address of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
The password of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
The port number of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable Default: |
|
If the schema is ‘vsphere’, gather these specific properties only |
|
Address of a proxy that will receive all HTTPS requests and relay them. The format is a hostname or a IP. If the value is not specified in the task, the value of environment variable |
|
Port of the HTTP proxy that will receive all HTTPS requests and relay them. If the value is not specified in the task, the value of environment variable |
|
Specify the output schema desired. The The Choices:
|
|
The username of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Choices:
|
Notes
Note
All modules require API write access and hence is not supported on a free ESXi license.
Examples
- name: Gather Cluster Information
vmware.vmware.cluster_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: datacenter
cluster_name: my_cluster
register: _out
- name: Gather Information About All Clusters In a Datacenter
vmware.vmware.cluster_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: datacenter
register: _out
- name: Gather Specific Properties About a Cluster
vmware.vmware.cluster_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
cluster_name: my_cluster
schema: vsphere
properties:
- name
- configuration.dasConfig.enabled
- summary.totalCpu
register: _out
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary that describes the clusters found by the search parameters The keys are the cluster names and the values are dictionaries with the cluster info. Returned: On success Sample: |