How to use wget and Github with vRealize Automation Blueprints

I recently started using GitHub as part of another blog post demonstrating how to integrate Ansible with vRealize Automation. It occurred to me that I could also use Github as a place to store scripts with version control as well as any other code I needed to deploy to a VM after it is provisioned from vRA. In this guide I will show you how to create a blueprint that your end users can utilize their Github content to automate their code deployments. Note: this guide requires that the provisioned VM’s have internet access to connect to GitHub.com if you want to do the same behind your firewall you can use GitLab see my blueprint to deploy this locally.

Pre-Reqs:

  • Installation of vRealize Automation 7 (Should also work in 6.x but I have not tested)
  • Working knowledge of Administering vRealize Automation
  • A Linux blueprint with the vRealize Automation Agent installed see my guide here
  • The example script I am running requires wget installed in the template and SELinux set to passive mode see guide here
  • A quite place where you will not be interrupted

Overview of this example

  1. Create a shell script on your Github account
  2. Create a blueprint with custom properties that will use wget in the guest provisioned from vRA to run the specifed script
  3. Present a form for your end user requestor to enter the URL to the script they want to run, the script name and any arguments they want to pass to the script when it is executed.

Let’s start by creating our blueprint

Create a new Linux Blueprint with the following properties defined.

VirtualMachine.Admin.UseGuestAgent  true
VirtualMachine.Customize.WaitComplete  true
VirtualMachine.Software0.ScriptPath  /usr/bin/wget -O /tmp/{Scriptname} {GithubURLtoScript}
VirtualMachine.Software1.ScriptPath  /tmp/{Scriptname} {Arguments}
Scriptname
GithubURLtoScript
Arguments

Publish and entitle the blueprint and fire off a request.

Notice the properties, I will show you how to get each of them

Go to my Gihub Ansible Examples Repository and scroll down and click the vragugent.sh file and click on it

Now click the RAW button to get the link URL to the RAW script file

Notice I created this script to install Ansible and Git and then clone my repo and run the playbook provided as an argument

Copy the URL to the clipboard

Paste that into the GithubURLtoScript field the script name is the name of the script in the URL above it

For the arguments we need to tell the script what playbook to run, go back to my Repo and copy the name of the playbook you want to run

Note: This script is tested for the RHEL/CENTOS7 Playbooks lamp_simple_rhel7 and wordpress-nginx_rhel7

Go back the vRA request page and paste this in the arguments and click submit

Once provisioning completes successfully, get the IP address of the new VM in items view

Open a web page to that address and see the results of your script running

7 Replies to “How to use wget and Github with vRealize Automation Blueprints”

  1. awesome giveaway :)…i cant say i have many memories sence both hunter and leigha were early losses. however, with both i had dreams of them before we even knew i was pregnant. Which is why i know their sexes, the dreams and my instinct told me what i needed to know.

  2. Need to find effective online marketing that isn’t completely full of it? I apologize for sending you this message on your contact form but actually that’s exactly where I wanted to make my point. We can send your ad message to sites through their contact forms just like you’re reading this ad right now. You can target by keyword or just do bulk blasts to websites in any country you choose. So let’s say you’re looking to send an ad to all the mortgage brokers in the United States, we’ll grab websites for only those and post your promo to them. Providing you’re promoting something that’s relevant to that niche then your business will get an awesome result!

    Write a quickie email to evie2535gre@gmail.com to find out how we do this

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.