homebloghow integrate puppet enterprise vmware cloud assembly

How to integrate Puppet Enterprise with VMware Cloud Assembly

At VMworld 2018 US, VMware upped their game in the IT Automation and DevOps space by announcing three new Cloud Automation Services, Cloud Assembly, Service Broker and Code Stream. Cloud Assembly provides an abstraction layer across multiple clouds using a Cloud API which makes it possible to create declarative templating constructs, which VMware calls Blueprints. Blueprints can deploy cloud agnostic resources (compute, storage, network etc.) across clouds. At this moment Cloud Assembly supports Amazon AWS, Microsoft Azure, VMware Cloud on AWS and vSphere (with or without NSX-V/T). But others will soon be added.

In this post I will walk you through how to integrate Puppet Enterprise with VMware Cloud Assembly and use it in your blueprint so that you can manage deployments for configuration and drift. In this example I'll be using a vSphere blueprint which I created in a previous post and saved by creating a version.

Set up your integration

To integrate Puppet based configuration management, you must have a valid instance of Puppet Enterprise installed on public cloud or private cloud with a vSphere workload. In public cloud, Cloud Assembly supports both Puppet Enterprise instances on Azure/AWS and OpsWorks (Managed PE) on AWS. Read here to learn more about setting up Puppet Enterprise with a basic configuration and some Starter Content.

You must establish a connection between this external system and your Cloud Assembly instance. Then you can make Puppet configuration management available to Cloud Assembly by adding it to appropriate blueprints.

  1. Login to Cloud Assembly, select Integrations under the Infrastructure tab. Click Add Integration.
  2. Select Puppet.
 integration puppet
  1. Enter your Puppet Enterprise server FQDN and Autosign secret.
  2. Select your Puppet Enterprise server location. In my case, Private Cloud.
  3. Select your Data Collector and enter your Puppet server credentials. Enable Sudo depending on the user you entered. Click Validate.
 integration puppet
  1. Enter a Name for the integration. Optionally, enter a Description. Click Add.
 integration puppet
 integration puppet scaled

Add Puppet to your blueprint

The blueprint Puppet provider component installs, configures, and runs the Puppet agent on a deployed compute resource. The Puppet provider supports both ssh and WinRM connections. When machines are deployed, users can add or delete a Puppet Master as an external system or update projects assigned to the Puppet Master. Finally, appropriate users can de-register deployed machines from the Puppet Master when the machines are decommissioned.

  1. Click on the Blueprints tab and select your previous vSphere blueprint.
 blueprint previous scaled
  1. In the left menu, scroll down or search for the Puppet component. Select it and drag it to the canvas.
 blueprint puppet component scaled
  1. In the YAML editor, click on + to view all available code properties for the Puppet component.
 blueprint puppet code
  1. Click on the host property to view what it means and what's expected.
 blueprint puppet host
  1. Enter ${Cloud_vSphere_Machine_1.*} as value for the host property. A dependency (arrow) will automatically be drawn to the vSphere machine in the canvas.
 blueprint puppet hostdependency
  1. Next, enter the Puppet role and environment under properties. But to know which roles are available in which environment, login to your Puppet Enterprise console, select Classification and expand Roles. In my case I'll be using the Wordpress role available in the Dev environment.
 puppet available roles scaled
  1. Enter the provider, the Puppet integration name you entered in the previous steps. In my case, ddeswart-PE-master.
  2. And finally, enter the osType (linux or windows) and user credentials for installing the Puppet agent. Optionally, change useSudo to true if you’re not using root.
 blueprint puppet codefinal

Version and deploy your blueprint

  1. In the blueprint canvas, click Version.
  2. Enter the Version number and optionally a Description and Change Log. Click Create.
 blueprint versioning
  1. In the blueprint canvas, click Deploy.
  2. Select Create a new deployment and enter a Deployment name. Select the Blueprint version you just created and click Deploy.
 blueprint deploy
  1. Click on the Deployments tab to see the progress of your deployment.
 bleuprint deploying scaled
  1. If successful, the deployed resources will be shown.
 blueprint deployed scaled
  1. Login to vCenter Server to verify the VM is available and running.
 vsphere machine scaled
  1. Then, login to the Puppet Enterprise console, to verify the VM has a Puppet agent, is added as node and has software deployed to it. In the console, select Overview or Nodes.
 puppet node scaled
  1. Click on the new node to view its Facts. Notice that Cloud Assembly properties of the VM are passed to Puppet as Facts.
 puppet node facts scaled
  1. Select the Reports tab to see what Puppet has done to bring the VM in the desired state. For example, install packages.
 puppet node report scaled
  1. Open a web browser, enter http:// to verify Wordpress is installed.
 wordpress available scaled

Et voila, Configuration Management integration made easy with VMware Cloud Assembly and Puppet Enterprise.

Happy coding!