In the last part of VMware automation, we will utilize the Ansible tool to administrate the VMware infrastructure. Ansible ships with more than 20 VMware modules (http://docs.ansible.com/ansible/latest/modules/list_of_cloud_modules.html#vmware), which can execute many tasks such as managing data centers, clusters, and virtual machines. In older Ansible versions, Ansible used the pysphere module (which is not official; the author of the module has not maintained it since 2013) to automate the tasks. However, the newer version now supports the pyvmomi bindings.
Ansible also supports the VMware SDN product (NSX). Ansible Tower can be accessed from VMware vRealize Automation (vRA), which allows for complete workflow integration between different tools.
The following is the Ansible Playbook:
- name: Provision New VM
hosts: localhost
connection...