This document discusses using Puppet to automate the deployment and configuration of virtual machines (VMs) in an Apache CloudStack infrastructure. It describes how Puppet can be used to deploy and configure CloudStack VMs according to their roles by parsing userdata passed to the VMs at launch. Custom Puppet facts can extract role information from the userdata to classify nodes and apply the appropriate configuration. The CloudStack and Puppet APIs can be combined to fully automate the provisioning and configuration of VMs from a clean state using Puppet manifests and resources.