Gather VMware ESX/ESXi Host Info with Ansible

By Luca Berton · Published 2024-01-01 · Category: installation

Discover how to gather info about VMware ESX/ESXi hosts in a cluster using Ansible. Follow our live Playbook and simple code examples to get started.

How to Gather Info about all VMware ESX/ESXi Hosts in a given Cluster with Ansible? I’m going to show you a live Playbook and some simple Ansible code.

I’m Luca Berton and welcome to today’s episode of Ansible Pilot

Ansible Gather Info about all VMware ESX/ESXi Hosts in given Cluster • community.vmware.vmware_host_config_info • Gathers info about an ESXi host’s advanced configuration information

Let’s talk about the Ansible module vmware_host_config_info. The full name is community.vmware.vmware_host_config_info, which means that is part of the collection of modules to interact with VMware, community-supported. The module's purpose is to gather info about an ESXi host’s advanced configuration information.

Parameters • hostname string / port integer / username string / password string / datacenter string / validate_certs boolean — connection details • cluster_name string — Name of the cluster from which the ESXi host belongs to. • esxi_hostname string — ESXi hostname to gather information from. The following parameters are useful in order to Gather Info about all VMware ESX/ESXi Hosts in the given Cluster using the module vmware_host_config_info.

First of all, we need to establish the connection with VMware vSphere or VMware vCenter using a plethora of self-explicative parameters: hostname, port, username, password, datacenter and validate_certs.

Once the connection is successfully established you could specify the full esxi_hostname, the ESX/ESXi hostname, or list all the hostnames in the current cluster cluster_name.

Linkscommunity.vmware.vmware_host_config_info

## Playbook

How to Gather Info about all VMware ESX/ESXi Hosts in given Cluster with Ansible.

I’m going to show you how to Gather Information on all the ESX/ESXi Host in the current VMware “production” cluster using Ansible Playbook.

code • host_info_cluser.yml • vars.yml

execution

code with ❤️ in GitHub

Conclusion Now you know how to Gather information about all VMware ESX/ESXi Hosts in a given Cluster using Ansible Playbook.

Related ArticlesAnsible Become GuideAnsible Loops Guide

Category: installation

Watch the video: Gather VMware ESX/ESXi Host Info with Ansible — Video Tutorial

Browse all Ansible tutorials · AnsiblePilot Home