Integrating Red Hat Ansible Tower with VMware vRealize Automation is a very popular enterprise automation solution. SovLabs has several excellent integrations that can help you accomplish and scale your integration of these two powerful cloud automation tools. This article is the first in a series of four articles covering the integration of Red Hat Ansible Tower with VMware vRealize Automation, based primarily on the content and discussion from our webinar with Red Hat Ansible on May 22.

  1. Requesting a vRealize Automation deployment from Ansible.  How, and why you would want to do it.
  2. The SovLabs Ansible Tower Module for vRealize Automation with Static Inventory
  3. The SovLabs Ansible Tower Module for vRealize Automation with Dynamic Inventory
  4. The SovLabs Ansible Tower Plug-in for vRealize Automation CM Framework


Requesting a vRealize Automation deployment from Ansible

With Ansible Tower quickly growing in popularity, many developers and system administrators want to be able to utilize Ansible Tower to deploy infrastructure.  This type of deployment is the subject of many debates within enterprise organizations, especially those with cloud teams trying to develop standards while enforcing policy and governance across organizations.

The good news is that organizations no longer have to choose between solutions. If you want to use Ansible to develop standards while enforcing policy and governance across organizations, now you can.  Using the solution below you can request workloads from Ansible facilitated by vRA to enforce the desired standards and governance policies. Let’s take a look at how it works.

  1. Ansible Tower initiates the request
  2. vRA receives the request and provisions the machine
  3. SovLabs integrations perform all the needed integrations
  4. SovLabs Ansible Tower module registers the machine to the Ansible Tower Inventory
  5. SovLabs Ansible Tower module invokes the requested Ansible Tower Job Templates against the deployed machine.

unnamedRequest vRealize Automation Blueprints with Ansible Tower 1

Something to think about before you begin

Consider the blueprint(s) you will build within vRA.  While you may have many blueprints and may want to change your Ansible request to use different blueprints for different requests, there is a better way.  In our three-part series called “Harness the power of vRealize Automation with the SovLabs Property Toolkit and Template Engine”, we walk you through how to create a dynamically-driven blueprint.  This methodology will allow you to utilize a single blueprint and pass in parameters to drive the outcome.

I will use the same approach covered in the “Harness the Power” series for this blog, utilizing a single blueprint, and passing in the appropriate information from Ansible that vRA will use to deploy exactly what we need, bolstered by the SovLabs modules.


How to set it up

First, you need to create your yaml file that will invoke the script needed to call vRA.  In my case that yaml looks like this:


– name: deploy-vRA-VM

 remote_user: root

 connection: ssh

 gather_facts: yes

 hosts: all


   – name: deploy-vRA-VM

     script: /opt/sovlabs/


Nothing fancy, but it gets the job done.  You can, of course, use facts to parameterize this yaml file however you like.  The example I’m showing has static settings just to illustrate the point.

Next, we need the script that is referenced in the yaml.  In this case, my script is called  The content of that script is below:


vAPI_TOKEN=”$(curl -s –insecure -H “Accept: application/json” -H ‘Content-Type: application/json’ –data ‘{“username”:””,”password”:”XXXXXXXX”,”tenant”:”demo-001″}’ https://fqdn.vra.appliance/identity/api/tokens | cut -d: -f5 | cut -d, -f1 | awk ‘{print substr($0, 2, length($0) – 2)}’ | tr -d “n”)”


AUTH=”Bearer ${vAPI_TOKEN}”


curl –insecure -X POST


 -H ‘Accept: application/json’

 -H “Authorization: $AUTH”

 -H ‘Cache-Control: no-cache’

 -H ‘Connection: keep-alive’

 -H ‘Content-Type: application/json’

 -H ‘Host:’

 -H ‘Postman-Token: dd84c77f-3132-407a-94ef-f019989bcd75,363ce053-1a96-48e2-81d3-a880004e83a4’

 -H ‘User-Agent: PostmanRuntime/7.13.0’

 -H ‘accept-encoding: gzip, deflate’

 -H ‘cache-control: no-cache’

 -H ‘consumer-catalog-item-guid: 0c3b6bda-782c-456e-a180-ba02c4821d65’

 -H ‘content-length: 2700’

 -d ‘{

   “type”: “com.vmware.vcac.catalog.domain.request.CatalogItemProvisioningRequest”,

   “catalogItemId”: “0c3b6bda-782c-456e-a180-ba02c4821d65”,

   “requestedFor”: “user@domaint”,

   “businessGroupId”: “”,

   “description”: null,

   “reasons”: null,


































                                                                               “label”:”Hard disk 1″,













































In the above script, there are six inputs that are important to me, each of which is shown in bold above.  These inputs are the only ones I will ever change and they are used to drive the outcome I am trying to achieve.  I should also point out that a lot of what you see above is very specific to my blueprint, so you should expect significant editing if you want this same script to work with your blueprints.

In my environment I can drive over 600+ different outcomes from a single blueprint just by passing a different input for the following properties:

  • SVL_App
  • SVL_Compliance
  • SVL_Env
  • SVL_Size

Having architected the solution this way, I could simply publish documentation that details the acceptable values that each input takes and pass that documentation on to whoever wants to consume vRA.  The documentation may need some updates as I add more values, but there is no need to publish information on dozens of blueprints (or more) and their inputs and values: I just need one blueprint.

The last piece of the integration of VMware vRealize Automation and Red Hat Ansible is to create a Job Template. You do need to have vRA setup and ready to go with your blueprint and the integrations you want to use, including the Ansible Tower integrations for Inventory and Job Template execution.  We will look at these components in the next three articles in this series.

Recommended Reading