How To Use Ansible To Automate AVI deployments in a VMware Cloud

Introduction

Server & infrastructure automation now plays an essential role in systems administration due to the disposable nature of modern environments. Tools such as Ansible are typically used to streamline the process of automating server setup by establishing standard procedures for new servers while also reducing human error associated with manual setups. It also offers the ability to spin up and destroy services and environments when you need them.

This series aim is to develop my ansible knowledge and create repeatable elements of VMware’s Software-Defined Datacentre in a lab environment but can also be consumed in real-world cases.

This guide will explain how to use Ansible and how to automate deploying and configuring AVI deployment within a VMware Environment. For ease ill break the deployment into a number of posts listed below:

Ansible Deployment

  • Deploy the AVI/NSX ALB Controller/s & configure the cluster (Section 1 in the diagram below)
  • Deploy NSX Cloud (Section 2 in the diagram below)
  • Deploy vSphere cloud (Section 2 in the diagram below)
  • Deploy Service Engines (Section 3 in the diagram below)
  • Deploy virtual service (Section 4 in the diagram below)
    • Deploy example virtual service for a Horzion Desktop Deployment

In a logical view, it should look like this:

Ansible Pre-requisites

But before we start deploying AVI using ansible, we need to complete and understand the pre-requisites. In this article, I will explain whats required.

Ansible roles needed for deployment

avinetworks.avisdk (Deployed from Ansible galaxy) avinetworks/ansible-role-avisdk: Avi Networks Ansible Modules (github.com)

avinetworks.avicontroller-vmware avinetworks/ansible-role-avicontroller-vmware: Ansible Role to setup Avi Controller on Vmware cloud (github.com)

avinetworks.avicontroller-vmware role requirements

Using this module, you can install the Avi Vantage Controller to the Vmware cloud.

pip install pyVmomi
  • pyVim
ip install pyvim 
  • ovftool (Installation bundle packaged with the role please run command ‘<roles_dir>/avinetworks.avicontroller-vmware/files/VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle’ to install ovftool)

avinetworks.avisdk ansible role requirements

This role requires Ansible 2.0 or higher. Requirements are listed in the metadata file.

Please install avisdk from pip before running this module.


pip install avisdk --upgrade

avinetworks.avisdk Installation

To install the AviSDK Ansible Module, please issue the command on the machine you will run Ansible from.


ansible-galaxy install -f avinetworks.avisdk

For more information, please visit http://docs.ansible.com/ansible/galaxy.html