際際滷

際際滷Share a Scribd company logo
Integrating
                    CloudStack
                    with Puppet



Saturday, December 1, 12
About me:

                    Dan Bode
                    Integration Specialist at PuppetLabs

                    @bodepd

                    bodepd <on> freenode




Saturday, December 1, 12
Who is this talk for?

         current CloudStack Users

         Puppet beginners




Saturday, December 1, 12
It will cover

         why integrate?

         explanation of Puppets architecture as it applies to
         integration

         using Puppet to model VM instances




Saturday, December 1, 12
Why Integrate?




Saturday, December 1, 12
Why integrate?

         CloudStack provides an API for provisioning virtual
         machines


 deployVirtualMachine



                            Self Service API



                                 VM1




Saturday, December 1, 12
Why integrate?

         Puppet converts freshly provisioned VMs into
         functional applications




                                              Self Service APi


                                                                    Make me an
                                                   VM1              apache server
                           Here are the
                           instructions for
                           becoming an
                                                                 Puppet
                           apache server
                                                                 Master

Saturday, December 1, 12
Why integrate?

         Combined, they create fully automated application
         stacks.

                            deploy me a DB,
                            then 2 apache servers



                                 Self Service APi



                           DB1      Apache1 Apache2




Saturday, December 1, 12
Understanding
                              Puppet




Saturday, December 1, 12
2 run modes

       puppet apply - all content is stored on the individual
       nodes. commonly used for testing (or for scale)

       client/server - content is served from a central
       master (this is what we will be talking about)




Saturday, December 1, 12
A Puppet client/server run

                           Classifier            Modules

                                        Master



                            Facts                  Catalog




                                        VM1




Saturday, December 1, 12
Facter returns system specific
       information

                             Classifier            Modules

                                          Master



                           Facts                     Catalog




                                          Agent




Saturday, December 1, 12
Facter

       to see a systems facts, run

       $ facter
       architecture => x86_64
       domain => local
       facterversion => 2.0.0
       fqdn => DansLapTop.local
       hardwareisa => i386
       hardwaremodel => x86_64
       id => danbode


Saturday, December 1, 12
Facter

              Nodes submit their facts as a part of the request
              for catalog.

              Available as top scope variables from manifests

              ie : $::fact_name

              Creating custom facts is easy.




Saturday, December 1, 12
A Puppet client/server run
                                                 Modules
                           Classifier

                                        Master



                            Facts                 Catalog




                                        VM1




Saturday, December 1, 12
Modules

              Sharable content composed of classes and defined
              resource types (configuration interfaces).




Saturday, December 1, 12
Module Forge


              http://forge.puppetlabs.com/

              http://forge.puppetlabs.com/puppetlabs/apache




Saturday, December 1, 12
Classes/defines compose resources




Saturday, December 1, 12
Resources

            Describe the con鍖guration state of individual system
            elements.

              user { dan:
                ensure => present,
                shell => /bin/bash,
              }




Saturday, December 1, 12
Resources

            Describe the con鍖guration state of individual system
            elements.

              user { dan:             # a user named dan
                ensure => present,      # should exist
                shell => /bin/bash,   # with this shell
              }




Saturday, December 1, 12
Resources

              package { apache2: # a package named apache2
                ensure => present, # should be installed
              }




Saturday, December 1, 12
Puppet DSL and resources




Saturday, December 1, 12
Puppet DSL and Resources

       The Puppet DSL can be used to compose collections of
       resources into classes or de鍖ned resources.




Saturday, December 1, 12
Example apache class
       class apache {
        package { apache2:
          ensure => present,
        }
        鍖le { /etc/apache2/apache2.conf:
          content => template(apache2/apache2.erb),
          require => Package[apache2],
        }
        service { apache2:
          ensure => running
          subscribe => File[/etc/apache2/apache2.conf]
           }
       }


Saturday, December 1, 12
A Puppet client/server run

                           Classifier
                                                 Modules

                                        Master



                                Facts              Catalog




                                        VM1




Saturday, December 1, 12
Classification


              Process that determines how Puppet maps a role
              to a specific instance.




Saturday, December 1, 12
Site manifest

                                Master
                           /etc/puppet/manifest/site.pp




     The master utilizes code from its site manifest to 鍖gure
     out how to assign a role to a node.




Saturday, December 1, 12
Site manifest
    Node blocks map a hosts certname to content from a
    module

       node /^my_node/ {
         include apache
       }




Saturday, December 1, 12
Determine role based on facts
                deploy me an apache server



                                             Self Service APi



                                                Apache1




Saturday, December 1, 12
Determine role based on facts

      deployVirtualMachine -> userdata -> facts

      node default {
        if $::role == apache {
          include apache
        } else {
          fail(Unde鍖ne role: ${role})
        }
      }




Saturday, December 1, 12
Decouple role assignment from
       provisioning
       After provisioning is completed, ssh into a machine,
       set a custom fact (using facts.d), and trigger a
       puppet run.

       pros - you can easily execute a script to install and
       bootstrap puppet

       cons - extra step




Saturday, December 1, 12
facts.d

       facts.d comes with stdlib
       (http://forge.puppetlabs.com/puppetlabs/stdlib)

       it converts any key=value pairs listed in /etc/
       facts.d/*.txt into facts




Saturday, December 1, 12
ENC
                                            ENC

                           Master


           The master can call out to arbitrary executables to
           鍖gure out how a node should be classi鍖ed.




Saturday, December 1, 12
ENC
          You can set the group attribute with classi鍖cation
          information when instances are created.

          The ENC can then query the group attribute from the
          VM instance that needs to be classi鍖ed.




Saturday, December 1, 12
A Puppet client/server run

                           Classifier            Modules

                                        Master



                            Facts
                                                   Catalog

                                        VM1




Saturday, December 1, 12
Catalog
          Collection of resources that describe how a node can
          achieve a speci鍖ed con鍖guration.




Saturday, December 1, 12
Catalog
     Resources
                                            Catalog
                                  Package

                           Package             File

                                                         File
                           User         User

                                  Service
Dependencies                                   Service


Saturday, December 1, 12
VM provisioning with Puppet
            (experimental! use cases
            appreciated)




Saturday, December 1, 12
Share Application Stacks as text

       class my_app_stack {
           cloudstack_instance { 'foo4':
               ensure      => present,
               group       => 'role=db',
           }
           cloudstack_instance { 'foo3':
               ensure      => present,
               group       => 'role=apache',
           }
       }




Saturday, December 1, 12
Use resource defaults for
       common settings
       Cloudstack_instance {
           image           => 'CentOS 5.6 key+pass',
           flavor          => 'Small Instance',
           zone            => 'ACS-FMT-001',
           network         => 'puppetlabs-network',
           keypair         => 'dans_keypair4',
       }
       cloudstack_instance { 'foo4':
           ensure          => $::ensure,
           group           => 'role=db',
       }
       cloudstack_instance { 'foo3':
           ensure          => $::ensure,
           group           => 'role=apache',
       }




Saturday, December 1, 12

More Related Content

What's hot (20)

hibernate
hibernatehibernate
hibernate
Arjun Shanka
Cassandra data modeling talk
Cassandra data modeling talkCassandra data modeling talk
Cassandra data modeling talk
Patrick McFadin
Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0
huangwenjun310
JRuby at Square
JRuby at SquareJRuby at Square
JRuby at Square
Marakana Inc.
D7 entities fields
D7 entities fieldsD7 entities fields
D7 entities fields
cyberswat
ARGUS - THE OMNISCIENT CI
ARGUS - THE OMNISCIENT CIARGUS - THE OMNISCIENT CI
ARGUS - THE OMNISCIENT CI
Cosmin Poieana
3 Networking CloudStack Developer Day
3  Networking CloudStack Developer Day 3  Networking CloudStack Developer Day
3 Networking CloudStack Developer Day
Kimihiko Kitase
DevCloud and CloudMonkey
DevCloud and CloudMonkeyDevCloud and CloudMonkey
DevCloud and CloudMonkey
Sebastien Goasguen
JCO Conference OpenStack
JCO Conference OpenStackJCO Conference OpenStack
JCO Conference OpenStack
Open Stack
Hadoop on Virtual Machines
Hadoop on Virtual MachinesHadoop on Virtual Machines
Hadoop on Virtual Machines
Richard McDougall
OpenStack Boston User Group, OpenStack overview
OpenStack Boston User Group, OpenStack overviewOpenStack Boston User Group, OpenStack overview
OpenStack Boston User Group, OpenStack overview
Open Stack
Apache Hadoop on Virtual Machines
Apache Hadoop on Virtual MachinesApache Hadoop on Virtual Machines
Apache Hadoop on Virtual Machines
DataWorks Summit
Objective C Memory Management
Objective C Memory ManagementObjective C Memory Management
Objective C Memory Management
Ahmed Magdy Ezzeldin, MSc.
iPhone Memory Management
iPhone Memory ManagementiPhone Memory Management
iPhone Memory Management
Vadim Zimin
iOS Memory Management Basics
iOS Memory Management BasicsiOS Memory Management Basics
iOS Memory Management Basics
Bilue
Cloudian dynamic consistency
Cloudian dynamic consistencyCloudian dynamic consistency
Cloudian dynamic consistency
CLOUDIAN KK
Cloudstack networking2
Cloudstack networking2Cloudstack networking2
Cloudstack networking2
Hiroaki Kawai
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
David Bosschaert
Intro to CloudStack Build a Cloud Day
Intro to CloudStack Build a Cloud DayIntro to CloudStack Build a Cloud Day
Intro to CloudStack Build a Cloud Day
Sebastien Goasguen
Memory management in Objective C
Memory management in Objective CMemory management in Objective C
Memory management in Objective C
Neha Gupta
Cassandra data modeling talk
Cassandra data modeling talkCassandra data modeling talk
Cassandra data modeling talk
Patrick McFadin
Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0
huangwenjun310
D7 entities fields
D7 entities fieldsD7 entities fields
D7 entities fields
cyberswat
ARGUS - THE OMNISCIENT CI
ARGUS - THE OMNISCIENT CIARGUS - THE OMNISCIENT CI
ARGUS - THE OMNISCIENT CI
Cosmin Poieana
3 Networking CloudStack Developer Day
3  Networking CloudStack Developer Day 3  Networking CloudStack Developer Day
3 Networking CloudStack Developer Day
Kimihiko Kitase
JCO Conference OpenStack
JCO Conference OpenStackJCO Conference OpenStack
JCO Conference OpenStack
Open Stack
Hadoop on Virtual Machines
Hadoop on Virtual MachinesHadoop on Virtual Machines
Hadoop on Virtual Machines
Richard McDougall
OpenStack Boston User Group, OpenStack overview
OpenStack Boston User Group, OpenStack overviewOpenStack Boston User Group, OpenStack overview
OpenStack Boston User Group, OpenStack overview
Open Stack
Apache Hadoop on Virtual Machines
Apache Hadoop on Virtual MachinesApache Hadoop on Virtual Machines
Apache Hadoop on Virtual Machines
DataWorks Summit
iPhone Memory Management
iPhone Memory ManagementiPhone Memory Management
iPhone Memory Management
Vadim Zimin
iOS Memory Management Basics
iOS Memory Management BasicsiOS Memory Management Basics
iOS Memory Management Basics
Bilue
Cloudian dynamic consistency
Cloudian dynamic consistencyCloudian dynamic consistency
Cloudian dynamic consistency
CLOUDIAN KK
Cloudstack networking2
Cloudstack networking2Cloudstack networking2
Cloudstack networking2
Hiroaki Kawai
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
David Bosschaert
Intro to CloudStack Build a Cloud Day
Intro to CloudStack Build a Cloud DayIntro to CloudStack Build a Cloud Day
Intro to CloudStack Build a Cloud Day
Sebastien Goasguen
Memory management in Objective C
Memory management in Objective CMemory management in Objective C
Memory management in Objective C
Neha Gupta

Viewers also liked (6)

Beginning Android Development
Beginning Android DevelopmentBeginning Android Development
Beginning Android Development
Jos辿 Ferreiro
Social media thoughts Show v1
Social media thoughts Show v1Social media thoughts Show v1
Social media thoughts Show v1
Henslee57
Director Version 2
Director Version 2Director Version 2
Director Version 2
Henslee57
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
Eb Styles
Titanium setup
Titanium setupTitanium setup
Titanium setup
Ket Majmudar
Community Works! Pfcongres 2011
Community Works! Pfcongres 2011Community Works! Pfcongres 2011
Community Works! Pfcongres 2011
Michelangelo van Dam
Beginning Android Development
Beginning Android DevelopmentBeginning Android Development
Beginning Android Development
Jos辿 Ferreiro
Social media thoughts Show v1
Social media thoughts Show v1Social media thoughts Show v1
Social media thoughts Show v1
Henslee57
Director Version 2
Director Version 2Director Version 2
Director Version 2
Henslee57
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
Eb Styles
Community Works! Pfcongres 2011
Community Works! Pfcongres 2011Community Works! Pfcongres 2011
Community Works! Pfcongres 2011
Michelangelo van Dam

Similar to Cloudstack talk (20)

Automatic Configuration of Your Cloud with Puppet
Automatic Configuration of Your Cloud with PuppetAutomatic Configuration of Your Cloud with Puppet
Automatic Configuration of Your Cloud with Puppet
Puppet
Cloud building talk
Cloud building talkCloud building talk
Cloud building talk
bodepd
TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with Jasmine
Stephen Pond
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
Docker, Inc.
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
J辿r担me Petazzoni
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
Achieve Internet
Puppet meetup testing
Puppet meetup testingPuppet meetup testing
Puppet meetup testing
Phil Zimmerman
Rapid Home Provisioning
Rapid Home ProvisioningRapid Home Provisioning
Rapid Home Provisioning
Ludovico Caldara
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
ke4qqq
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
Puppet
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
ke4qqq
Docker Based Hadoop Provisioning
Docker Based Hadoop ProvisioningDocker Based Hadoop Provisioning
Docker Based Hadoop Provisioning
DataWorks Summit
Why Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data WorldWhy Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data World
Dean Wampler
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Enrico Zimuel
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
ke4qqq
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp Boston
Puppet
Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deployment
zeeg
CloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCatCloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCat
Andrew Bayer
BDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part IIBDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part II
David Lauzon
Automating CloudStack with Puppet - David Nalley
Automating CloudStack with Puppet - David NalleyAutomating CloudStack with Puppet - David Nalley
Automating CloudStack with Puppet - David Nalley
Puppet
Automatic Configuration of Your Cloud with Puppet
Automatic Configuration of Your Cloud with PuppetAutomatic Configuration of Your Cloud with Puppet
Automatic Configuration of Your Cloud with Puppet
Puppet
Cloud building talk
Cloud building talkCloud building talk
Cloud building talk
bodepd
TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with Jasmine
Stephen Pond
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
Docker, Inc.
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
J辿r担me Petazzoni
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
Achieve Internet
Puppet meetup testing
Puppet meetup testingPuppet meetup testing
Puppet meetup testing
Phil Zimmerman
Rapid Home Provisioning
Rapid Home ProvisioningRapid Home Provisioning
Rapid Home Provisioning
Ludovico Caldara
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
ke4qqq
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
Puppet
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
ke4qqq
Docker Based Hadoop Provisioning
Docker Based Hadoop ProvisioningDocker Based Hadoop Provisioning
Docker Based Hadoop Provisioning
DataWorks Summit
Why Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data WorldWhy Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data World
Dean Wampler
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Enrico Zimuel
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
ke4qqq
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp Boston
Puppet
Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deployment
zeeg
CloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCatCloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCat
Andrew Bayer
BDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part IIBDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part II
David Lauzon
Automating CloudStack with Puppet - David Nalley
Automating CloudStack with Puppet - David NalleyAutomating CloudStack with Puppet - David Nalley
Automating CloudStack with Puppet - David Nalley
Puppet

More from bodepd (7)

Openstack havana
Openstack havanaOpenstack havana
Openstack havana
bodepd
Puppet as data_chicago
Puppet as data_chicagoPuppet as data_chicago
Puppet as data_chicago
bodepd
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?
bodepd
Openstack grizzley puppet_talk
Openstack grizzley puppet_talkOpenstack grizzley puppet_talk
Openstack grizzley puppet_talk
bodepd
Hacking puppet
Hacking puppetHacking puppet
Hacking puppet
bodepd
Google compute presentation puppet conf
Google compute presentation puppet confGoogle compute presentation puppet conf
Google compute presentation puppet conf
bodepd
Openstack presentation
Openstack presentationOpenstack presentation
Openstack presentation
bodepd
Openstack havana
Openstack havanaOpenstack havana
Openstack havana
bodepd
Puppet as data_chicago
Puppet as data_chicagoPuppet as data_chicago
Puppet as data_chicago
bodepd
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?
bodepd
Openstack grizzley puppet_talk
Openstack grizzley puppet_talkOpenstack grizzley puppet_talk
Openstack grizzley puppet_talk
bodepd
Hacking puppet
Hacking puppetHacking puppet
Hacking puppet
bodepd
Google compute presentation puppet conf
Google compute presentation puppet confGoogle compute presentation puppet conf
Google compute presentation puppet conf
bodepd
Openstack presentation
Openstack presentationOpenstack presentation
Openstack presentation
bodepd

Cloudstack talk

  • 1. Integrating CloudStack with Puppet Saturday, December 1, 12
  • 2. About me: Dan Bode Integration Specialist at PuppetLabs @bodepd bodepd <on> freenode Saturday, December 1, 12
  • 3. Who is this talk for? current CloudStack Users Puppet beginners Saturday, December 1, 12
  • 4. It will cover why integrate? explanation of Puppets architecture as it applies to integration using Puppet to model VM instances Saturday, December 1, 12
  • 6. Why integrate? CloudStack provides an API for provisioning virtual machines deployVirtualMachine Self Service API VM1 Saturday, December 1, 12
  • 7. Why integrate? Puppet converts freshly provisioned VMs into functional applications Self Service APi Make me an VM1 apache server Here are the instructions for becoming an Puppet apache server Master Saturday, December 1, 12
  • 8. Why integrate? Combined, they create fully automated application stacks. deploy me a DB, then 2 apache servers Self Service APi DB1 Apache1 Apache2 Saturday, December 1, 12
  • 9. Understanding Puppet Saturday, December 1, 12
  • 10. 2 run modes puppet apply - all content is stored on the individual nodes. commonly used for testing (or for scale) client/server - content is served from a central master (this is what we will be talking about) Saturday, December 1, 12
  • 11. A Puppet client/server run Classifier Modules Master Facts Catalog VM1 Saturday, December 1, 12
  • 12. Facter returns system specific information Classifier Modules Master Facts Catalog Agent Saturday, December 1, 12
  • 13. Facter to see a systems facts, run $ facter architecture => x86_64 domain => local facterversion => 2.0.0 fqdn => DansLapTop.local hardwareisa => i386 hardwaremodel => x86_64 id => danbode Saturday, December 1, 12
  • 14. Facter Nodes submit their facts as a part of the request for catalog. Available as top scope variables from manifests ie : $::fact_name Creating custom facts is easy. Saturday, December 1, 12
  • 15. A Puppet client/server run Modules Classifier Master Facts Catalog VM1 Saturday, December 1, 12
  • 16. Modules Sharable content composed of classes and defined resource types (configuration interfaces). Saturday, December 1, 12
  • 17. Module Forge http://forge.puppetlabs.com/ http://forge.puppetlabs.com/puppetlabs/apache Saturday, December 1, 12
  • 19. Resources Describe the con鍖guration state of individual system elements. user { dan: ensure => present, shell => /bin/bash, } Saturday, December 1, 12
  • 20. Resources Describe the con鍖guration state of individual system elements. user { dan: # a user named dan ensure => present, # should exist shell => /bin/bash, # with this shell } Saturday, December 1, 12
  • 21. Resources package { apache2: # a package named apache2 ensure => present, # should be installed } Saturday, December 1, 12
  • 22. Puppet DSL and resources Saturday, December 1, 12
  • 23. Puppet DSL and Resources The Puppet DSL can be used to compose collections of resources into classes or de鍖ned resources. Saturday, December 1, 12
  • 24. Example apache class class apache { package { apache2: ensure => present, } 鍖le { /etc/apache2/apache2.conf: content => template(apache2/apache2.erb), require => Package[apache2], } service { apache2: ensure => running subscribe => File[/etc/apache2/apache2.conf] } } Saturday, December 1, 12
  • 25. A Puppet client/server run Classifier Modules Master Facts Catalog VM1 Saturday, December 1, 12
  • 26. Classification Process that determines how Puppet maps a role to a specific instance. Saturday, December 1, 12
  • 27. Site manifest Master /etc/puppet/manifest/site.pp The master utilizes code from its site manifest to 鍖gure out how to assign a role to a node. Saturday, December 1, 12
  • 28. Site manifest Node blocks map a hosts certname to content from a module node /^my_node/ { include apache } Saturday, December 1, 12
  • 29. Determine role based on facts deploy me an apache server Self Service APi Apache1 Saturday, December 1, 12
  • 30. Determine role based on facts deployVirtualMachine -> userdata -> facts node default { if $::role == apache { include apache } else { fail(Unde鍖ne role: ${role}) } } Saturday, December 1, 12
  • 31. Decouple role assignment from provisioning After provisioning is completed, ssh into a machine, set a custom fact (using facts.d), and trigger a puppet run. pros - you can easily execute a script to install and bootstrap puppet cons - extra step Saturday, December 1, 12
  • 32. facts.d facts.d comes with stdlib (http://forge.puppetlabs.com/puppetlabs/stdlib) it converts any key=value pairs listed in /etc/ facts.d/*.txt into facts Saturday, December 1, 12
  • 33. ENC ENC Master The master can call out to arbitrary executables to 鍖gure out how a node should be classi鍖ed. Saturday, December 1, 12
  • 34. ENC You can set the group attribute with classi鍖cation information when instances are created. The ENC can then query the group attribute from the VM instance that needs to be classi鍖ed. Saturday, December 1, 12
  • 35. A Puppet client/server run Classifier Modules Master Facts Catalog VM1 Saturday, December 1, 12
  • 36. Catalog Collection of resources that describe how a node can achieve a speci鍖ed con鍖guration. Saturday, December 1, 12
  • 37. Catalog Resources Catalog Package Package File File User User Service Dependencies Service Saturday, December 1, 12
  • 38. VM provisioning with Puppet (experimental! use cases appreciated) Saturday, December 1, 12
  • 39. Share Application Stacks as text class my_app_stack { cloudstack_instance { 'foo4': ensure => present, group => 'role=db', } cloudstack_instance { 'foo3': ensure => present, group => 'role=apache', } } Saturday, December 1, 12
  • 40. Use resource defaults for common settings Cloudstack_instance { image => 'CentOS 5.6 key+pass', flavor => 'Small Instance', zone => 'ACS-FMT-001', network => 'puppetlabs-network', keypair => 'dans_keypair4', } cloudstack_instance { 'foo4': ensure => $::ensure, group => 'role=db', } cloudstack_instance { 'foo3': ensure => $::ensure, group => 'role=apache', } Saturday, December 1, 12