Puppet Enterprise with vCAC – Part 1 Automatically install the PE agent

This guide will show you how to integrate Puppet Enterprise with vCAC. This will allow you to have day 2 configuration management of servers provisioned by vCAC as well as be able to offer a self service application portal. In part 1 we will walk through how to configure vCAC to automatically install the Puppet Agent and register with the puppet master. This guide will require the following:

  • vCAC 6 installed and configured to provision to vSphere
  • A Linux based blueprint with the Linux guest agent configured and working. See my guide here
  • Puppet Enterprise 3.x Master and Console installed and configured
  • An NFS share that can be mounted to the Linux Guest Agent blueprint once provisioned.

Basic flow of Events for this integration:

  1. vCAC will provision a VM based off of a pre-configured Linux Template in vSphere
  2. The Linux Guest agent will run a script in the guest to mount and NFS share
  3. The Linux Agent in the Guest will run a shell script to install Puppet Enterprise Agent and configure it to register with the Puppet Master you specify.
  4. vCAC will hand control over to requester.

Step 1: Power on your Linux template and create a new directory /repo

media_1398379252037.png

Step 2: Create a shell script named repomount.sh with the following and save it to the / directory ( you are creating a command to mount an NFS share that will take two variables as inputs.)

media_1398379337997.png
mount -t nfs $1:$2 /repo &> /repomount.log

Step 3: Now make the file executable then shutdown your template VM. NOTE: If you are using Linked Clones you will need to run an inventory in vCAC and select the new snapshot for this blueprint.

media_1398379520123.png

Step 4: Now let’s setup the files we need in the NFS share to install the Puppet agent and register with the Puppet master. NOTE: I am using the Puppet Master as my NFS share. This is not required. First you will need to download and copy the Puppet Enterprise install for your Linux Operating system to the NFS share. Your install directory should look like this:

media_1398380422432.png

Step 5: edit the agent_no_cloud.answer.sample file and add your puppet master server name.

media_1400023958283.jpg

Step 6: Now create a file installpuppet.sh on the NFS share with the following: Note: This script is running in the guest so all paths need to be relevant to the NFS share that gets mounted to repo in the guest. This script installs puppet agent with the answer file we edited in the previous step.

puppetinstall

Copy and Paste text:

sh /repo/puppetinstall/puppet-enterprise-3.2.1-el-6-x86_64/puppet-enterprise-installer -a /repo/puppetinstall/puppet-enterprise-3.2.1-el-6-x86_64/agent_no_cloud.answer.sample &> /installpuppet.log

Step 6a: Don’t forget to make it executable

media_1398380868083.png

Step 7: Now let’s create our Build profile in vCAC. Create a new Build profile with the following Properties:

media_1398381677478.png
repo.path /etc/puppetlabs/puppet
 repo.server puppetmaster.corp.local
 VirtualMachine.Admin.UseGuestAgent     true
 VirtualMachine.Customize.WaitComplete true
 VirtualMachine.Software0.Name repomount.sh
 VirtualMachine.Software0.ScriptPath /repomount.sh {repo.server} {repo.path}
 VirtualMachine.Software1.Name installpuppet.sh
 VirtualMachine.Software1.ScriptPath /repo/installpuppet.sh
 VMware.VirtualCenter.OperatingSystem     rhel5_64Guest

Step 8: Assign this new build profile to your Blueprint and save it

media_1398381932778.png

Step 9: Fire off a new request and check the Puppet Master for a new Node Request. In Part 2 I will show you how to Sign the node request and add the Node to a group in Puppet Enterprise and start a Puppet Run.

media_1400024059393.png

Remember sharing is caring!

16 Replies to “Puppet Enterprise with vCAC – Part 1 Automatically install the PE agent”

  1. Very interesting “Day 2” automation stuff Ryan – Puppet is a very popular DevOps tool for declarative application configuration management in a Cloud and on premise alike. Also interesting to note that I am working on a “mirror task” project: automation of installation of vCAC components into a target environment (VCE vBlock) using Puppet Master – nodes configuration to kick off installation processes.

  2. Pingback: Newsletter: May 18, 2014 | Notes from MWhite

  3. Thank You
    ABR Neuro Multi Specialty Hospitals Neurologist Hyderabad Best Neurologist In As Rao Nagar. Get World-Class Neurology Treatment Dr RaghuRam is a neurophysician specializing in neurology and trained to investigate, or diagnose and treat all neurological disorders.

Leave a Reply to online pizza deals near me Cancel 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.