SlideShare a Scribd company logo
Provisioning with Puppet




Photo: http://www.flickr.com/photos/vasta/4463786284/
$ whoami
    Joe Ray
    Senior Systems Developer
    Future Publishing
    @jr261
Overview

• Why you should use provisioners
• What is Puppet?
• How do you use it?
• Using Puppet with Vagrant
• Using Puppet in production
Why use provisioners?
• Reproducible setup
• Write less documentation
• Same config for multiple platforms
• Scale your setup
  • Easily move from development to
    production
  • Distribute amongst team
  • SSH access not necessary
• Use associated tools
What is Puppet?

•   Configuration management tool

•   Platform-agnostic (supports Linux, Free/OpenBSD,
    OSX, Windows, Solaris)

•   Description of systems' configuration using
    manifests

•   Idempotent
Resources

• Building blocks of configuration:
 • packages
 • services
 • files
 • users / groups
Resources
package { 'nginx':
  ensure => present,
}


user { 'joe':
  ensure      => present,
  shell       => '/bin/zsh',
  home        => '/home/joe',
}
Modules
• Self-contained, reusable sets of resources
• Typical pattern:
 • Install package
 • Manage service
 • Provide configuration helpers (defined
    types)
• http://forge.puppetlabs.com
Modules
class nginx($workers=1, $ensure=present) {
  package { nginx:
    ensure => $ensure,
  }

    service { nginx:
      ensure    => $ensure,
      subscribe => File["/etc/nginx/nginx.conf"],
      require   => File["/etc/nginx/nginx.conf"],
    }

    file { "/etc/nginx/nginx.conf":
      ensure => $ensure,
      content => template("nginx/nginx.conf.erb"),
      require => Package[nginx],
    }
}
Templates
server {
! listen 80;
! server_name <%= domain %>;

!   root <%= root %>;

!   access_log /var/log/nginx/<%= domain %>.access.log;

!   keepalive_timeout 5;

!   location / {
         index index.html index.htm;
!   }
}
Using modules
include nginx


class { 'nginx':
  'workers' => 5,
}


nginx::site { 'www.mywebsite.com':
  'config' => 'www.mywebsite.com',
  'root'    => '/data/www.mywebsite.com',
}
Using with
Vagrant::Config.run do |config|
  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "manifests"
    puppet.manifest_file = "my_manifest.pp"
  end
end
Facts
• How Puppet knows about your system
$ facter
architecture => amd64
domain => vagrantup.com
facterversion => 1.6.17
fqdn => debian6.vagrantup.com
hardwareisa => unknown
hardwaremodel => x86_64
hostname => debian6
id => vagrant
interfaces => eth0,lo
ipaddress => 10.0.2.15
etc...
Using with
Vagrant::Config.run do |config|
  config.vm.provision :puppet, :facts =>
{"vagrant" => "vagrant"} do |puppet|
    puppet.manifests_path = "manifests"
    puppet.manifest_file = "my_manifest.pp"
  end
end
Using with
server {
! listen 80;
! server_name <%= domain %>;

!   root <%= root %>;

    <% if @vagrant %>
    satisfy any;
    deny all;
    allow 192.168.33.1;
    allow 10.0.2.2;
    <% end %>

!   access_log /var/log/nginx/<%= domain %>.access.log;

!   keepalive_timeout 5;

!   location / {
         index index.html index.htm;
!   }
}
Using Puppet in production
  manifests /         git / svn
                                       Puppetmaster
 modules / files   or whatever


    REST over HTTPS               Reports



             Client                         Client    Client
What next?


• Example Puppet project at: github.com/
  josno/puppet-example
• Read the docs: docs.puppetlabs.com

More Related Content

PDF
Getting Started with Ansible
PPTX
Ansible intro
PDF
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
PDF
Infrastructure = Code
PDF
Multiple django applications on a single server with nginx
PPTX
nginx + uwsgi emperor + bottle
PDF
Ansible Automation to Rule Them All
ODP
Ansible basics workshop
Getting Started with Ansible
Ansible intro
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
Infrastructure = Code
Multiple django applications on a single server with nginx
nginx + uwsgi emperor + bottle
Ansible Automation to Rule Them All
Ansible basics workshop

What's hot (20)

PPTX
uWSGI - Swiss army knife for your Python web apps
PDF
#OktoCampus - Workshop : An introduction to Ansible
PDF
A quick intro to Ansible
PDF
Introducing Ansible
PDF
Introduction to ansible
ODP
Linuxday.at - Lightning Talk
PDF
Automation with ansible
PDF
Ansible 101
PDF
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
PDF
Ansible Introduction - Ansible Brno #1 - David Karban
PDF
Network Automation: Ansible 102
PPT
Ansible presentation
PDF
Jenkins and ansible reference
PDF
Red Hat Satellite 6 - Automation with Puppet
PPTX
Bower - A package manager for the web
PPTX
Node.js in a heterogeneous system
PDF
docker build with Ansible
PDF
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
PDF
Custom Non-RDS Multi-AZ Mysql Replication
PDF
IT Automation with Ansible
uWSGI - Swiss army knife for your Python web apps
#OktoCampus - Workshop : An introduction to Ansible
A quick intro to Ansible
Introducing Ansible
Introduction to ansible
Linuxday.at - Lightning Talk
Automation with ansible
Ansible 101
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Ansible Introduction - Ansible Brno #1 - David Karban
Network Automation: Ansible 102
Ansible presentation
Jenkins and ansible reference
Red Hat Satellite 6 - Automation with Puppet
Bower - A package manager for the web
Node.js in a heterogeneous system
docker build with Ansible
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Custom Non-RDS Multi-AZ Mysql Replication
IT Automation with Ansible
Ad

Viewers also liked (10)

PDF
Ashley R. White Portfolio 2015
PPT
Historia
PPTX
"C" Doesn't Stand for Chocolate (Ahava Leibtag, AhaMedia.com)
PPT
Historia
PPTX
Inspela presentation
PPTX
Nowar. presentation
PDF
Estrategias de atencion para las diferentes discapacidades
PPTX
Хурамшимнай арадай аман зохёолhоо
PDF
Geometri analitik bidang lingkaran
DOCX
Ulasan kritis bf
Ashley R. White Portfolio 2015
Historia
"C" Doesn't Stand for Chocolate (Ahava Leibtag, AhaMedia.com)
Historia
Inspela presentation
Nowar. presentation
Estrategias de atencion para las diferentes discapacidades
Хурамшимнай арадай аман зохёолhоо
Geometri analitik bidang lingkaran
Ulasan kritis bf
Ad

Similar to Provisioning with Puppet (20)

PDF
Improving Operations Efficiency with Puppet
PDF
From Dev to DevOps - Codemotion ES 2012
PDF
20090514 Introducing Puppet To Sasag
PDF
From Dev to DevOps
PDF
Puppet: Eclipsecon ALM 2013
PDF
Puppet modules: An Holistic Approach
PDF
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
KEY
From Dev to DevOps - ApacheCON NA 2011
PDF
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
PPTX
One click deployment
KEY
From Dev to DevOps - FOSDEM 2012
PDF
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
PDF
Automating Complex Setups with Puppet
PDF
Deployer - Deployment tool for PHP
PPS
A Presentation about Puppet that I've made at the OSSPAC conference
PDF
Deploying nginx with minimal system resources
PPTX
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
ODP
Making a Robust Installer for Linux Server Applications with Puppet Modules
PDF
Developing IT infrastructures with Puppet
PDF
Pyramid Deployment and Maintenance
Improving Operations Efficiency with Puppet
From Dev to DevOps - Codemotion ES 2012
20090514 Introducing Puppet To Sasag
From Dev to DevOps
Puppet: Eclipsecon ALM 2013
Puppet modules: An Holistic Approach
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
From Dev to DevOps - ApacheCON NA 2011
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
One click deployment
From Dev to DevOps - FOSDEM 2012
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Automating Complex Setups with Puppet
Deployer - Deployment tool for PHP
A Presentation about Puppet that I've made at the OSSPAC conference
Deploying nginx with minimal system resources
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
Making a Robust Installer for Linux Server Applications with Puppet Modules
Developing IT infrastructures with Puppet
Pyramid Deployment and Maintenance

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
KodekX | Application Modernization Development
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
KodekX | Application Modernization Development
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
MYSQL Presentation for SQL database connectivity
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars

Provisioning with Puppet

  • 1. Provisioning with Puppet Photo: http://www.flickr.com/photos/vasta/4463786284/
  • 2. $ whoami Joe Ray Senior Systems Developer Future Publishing @jr261
  • 3. Overview • Why you should use provisioners • What is Puppet? • How do you use it? • Using Puppet with Vagrant • Using Puppet in production
  • 4. Why use provisioners? • Reproducible setup • Write less documentation • Same config for multiple platforms • Scale your setup • Easily move from development to production • Distribute amongst team • SSH access not necessary • Use associated tools
  • 5. What is Puppet? • Configuration management tool • Platform-agnostic (supports Linux, Free/OpenBSD, OSX, Windows, Solaris) • Description of systems' configuration using manifests • Idempotent
  • 6. Resources • Building blocks of configuration: • packages • services • files • users / groups
  • 7. Resources package { 'nginx': ensure => present, } user { 'joe': ensure => present, shell => '/bin/zsh', home => '/home/joe', }
  • 8. Modules • Self-contained, reusable sets of resources • Typical pattern: • Install package • Manage service • Provide configuration helpers (defined types) • http://forge.puppetlabs.com
  • 9. Modules class nginx($workers=1, $ensure=present) { package { nginx: ensure => $ensure, } service { nginx: ensure => $ensure, subscribe => File["/etc/nginx/nginx.conf"], require => File["/etc/nginx/nginx.conf"], } file { "/etc/nginx/nginx.conf": ensure => $ensure, content => template("nginx/nginx.conf.erb"), require => Package[nginx], } }
  • 10. Templates server { ! listen 80; ! server_name <%= domain %>; ! root <%= root %>; ! access_log /var/log/nginx/<%= domain %>.access.log; ! keepalive_timeout 5; ! location / { index index.html index.htm; ! } }
  • 11. Using modules include nginx class { 'nginx': 'workers' => 5, } nginx::site { 'www.mywebsite.com': 'config' => 'www.mywebsite.com', 'root' => '/data/www.mywebsite.com', }
  • 12. Using with Vagrant::Config.run do |config| config.vm.provision :puppet do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "my_manifest.pp" end end
  • 13. Facts • How Puppet knows about your system $ facter architecture => amd64 domain => vagrantup.com facterversion => 1.6.17 fqdn => debian6.vagrantup.com hardwareisa => unknown hardwaremodel => x86_64 hostname => debian6 id => vagrant interfaces => eth0,lo ipaddress => 10.0.2.15 etc...
  • 14. Using with Vagrant::Config.run do |config| config.vm.provision :puppet, :facts => {"vagrant" => "vagrant"} do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "my_manifest.pp" end end
  • 15. Using with server { ! listen 80; ! server_name <%= domain %>; ! root <%= root %>; <% if @vagrant %> satisfy any; deny all; allow 192.168.33.1; allow 10.0.2.2; <% end %> ! access_log /var/log/nginx/<%= domain %>.access.log; ! keepalive_timeout 5; ! location / { index index.html index.htm; ! } }
  • 16. Using Puppet in production manifests / git / svn Puppetmaster modules / files or whatever REST over HTTPS Reports Client Client Client
  • 17. What next? • Example Puppet project at: github.com/ josno/puppet-example • Read the docs: docs.puppetlabs.com