I wanted to add a configuration file for aligning ESXi setups using Ansible. I find it a very easy way to just have an ESXi setup with username and password and IP.
So this is not a full setup of network boot, that should come later in another blog post. This is more if you are setting up a few ESXi hosts and then you will be able to get them configured. This approach at the moment also uses a 1:1 config. This was down to what we were doing in a Brownfield deployment and we could only move one host at a time. If you would want to do more at a time you can of course configure the Ansible hosts file to do so. There is something here about setting up the ansible hosts file. This will of course require you to reconfigure the variable file a bit.
So to sum up the pre-requisites to using the below is to have:
ESXi setup with an IP, and root password configured. That is the manual steps involved here.
The Config files:
I tend to use two variable files. One for the 99% of variables and a second variable file for passwords and license keys. The second one is an encrypted file.
This is to keep things as secure as possible. Here about how to create and use the encryption in Ansible to secure files.
I did do this as a single post originally but given the length I broke it down a bit into 2 sections, Variables and workbook: