Blueprints as Code in vRealize Automation 7 Part 2 – Adding Blueprints to Github and Setting up Jenkins

Welcome to part 2 of this 3-part series on blueprints as code in vRealize Automation 7 (vRA 7). In part 1, we walked through how to export blueprints from vRA 7. In this post we’ll discuss putting those exported blueprints into a source control system (Github) and setup our Jenkins server.  Here are links to the full series:

Blueprints as Code in vRealize Automation 7 Part 1 – Exporting Blueprints

Blueprints as Code in vRealize Automation 7 Part 2 – Adding Blueprints to Github and Setting up Jenkins

Blueprints as Code in vRealize Automation 7 Part 3 – Creating a New Jenkins Job

The first thing we’ll need to do is setup a server for Jenkins to run on. In this example i’m using a CentOS 6.6 machine, however, Jenkins can be installed on Unix/Linux or Windows. Jenkins does require Java 7 or above and Servlet 3.1. I will detail the instructions for RedHat distributions, but if you’re running something other than Redhat check out the Jenkins download page.


Installing Jenkins

To begin, lets add the Jenkins repos and install Jenkins. Type the following commands:

We will also need to install java

Start the Jenkins service and ensure that it autostarts

If you’re using the firewall go ahead and add these rules or disable iptables:

Lets ensure Jenkins is up and running. Navigate to http://<ip or hostname>:8080

You should now see a screen that asks you for a password. Copy the password from the Jenkins machine located at /var/lib/jenkins/secrets/initialAdminPassword

Copy and paste the password into the Jenkins login screen in our browser. A ‘Getting Started” screen should now appear. Go ahead and click the Install suggested plugins button. Of course you don’t HAVE to do this, but we will for the purposes of this walk-through. Once it completes create the first admin user and click the Save and Finish button. Alternatively, you can just choose to continue as admin, which is what I’ve done. Click the Start using Jenkins button.


[This part of the article assumes a basic knowledge of Github]

Adding the Blueprint to Source Control

Now that we’ve got Jenkins installed, lets get the blueprint we exported from part 1 of the series into our source control system. I’ve created a repo called blueprints in my organization. The first thing we need to do is initialize our local branch; i’m using a Windows 7 system for this.

Unpackage the .zip file you generated in part 1 of the series to a folder. In this example i’ve unpackaged the files to blueprints/Win2K8R2. I’ve also already initialized the blueprints folder by running the git init command. Once you’ve unpackaged the the blueprint lets add it the local repo and push it to our repo:

That’s it! You’ve set up a Jenkins server and exported blueprint the blueprint to Github. In the third and final part of the series we will setup a new Jenkins job which will take the any changes made to the blueprint and automatically update the existing blueprint within vRealize Automation.

Comments 1

Leave a Reply

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