This document discusses using Puppet to manage infrastructure as code with Apache CloudStack. It describes how Puppet types and providers were developed to allow defining CloudStack instances and entire application stacks in Puppet manifests. This enables automated deployment and configuration of infrastructure along with software configuration. Examples are given of using Puppet to define CloudStack instances, groups of instances that make up an application stack, and setting defaults for attributes. Resources mentioned include the CloudStack and Puppet GitHub pages.
18. Corresponding
class base {
manifest
case $::fact {
'webserver': {
include httpd
}
'database': {
include postgresql
}
}
}
19. Links, et al
Fact:
http://s.apache.org/acs_userdata
Blog with details:
http://s.apache.org/acs_userdata2
20. Video is here, go watch it
• I only have 45 minutes - so can't delve into
everything, you should watch the video- it’s
great.
• http://youtu.be/c8YWctfOpwo
21. And then there was a
knife.....plugin
• So the folks at Edmunds.com wrote a knife
plugin for CloudStack.
• The knife plugin had the ability to define an
application stack, potentially hundreds of
nodes, that are interrelated, and provision
them with a single knife command.
• https://github.com/cloudstack-extras/knife-cloudstack
26. Then at FOSDEM 2012
• CloudStack user shows me Puppet types
and resources for OpenNebula.
• https://puppetlabs.com/blog/puppetizing-opennebula/
• They indicated they wanted this
awesomeness for CloudStack....
27. Why???
• They wanted to define each of their application
stacks in puppet, so that not only the
configuration of software on the machine, but
the machines themselves would be configured
by Puppet.
• Automated deployment of test environments
that are exactly the same
• Really gets outside of machine configuration to
entire infrastructure configuration
28. ...and then at
PuppetConf
• There was Google Compute Engine types
and resources for Puppet.
• Dan Bode gave a presentation showing off
the work he had done... that presentation is
worth seeing...
• http://www.slideshare.net/bodepd/google-compute-presentation-puppet-conf
29.
30. So then for Christmas...
• puppet types and providers arrived -
courtesy of Dan Bode
• https://github.com/bodepd/cloudstack_resources
31. So how does this work
cloudstack_instance { 'foo1':
ensure => present,
flavor => 'Small Instance',
zone => 'FMT-ACS-001',
image => 'CentOS 5.6(64-bit) no GUI (XenServer)',
network => 'puppetlabs-network',
# domain
# account
# hostname
}
32. A simple stack
class my_web_stack {
cloudstack_instance { 'foo4':
ensure => present,
group => 'role=apache',
}
cloudstack_instance { 'foo5':
ensure => present,
group => 'role=db',
}
}