SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
Jan Gehring
 

Tendances (20)

uWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web appsuWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web apps
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karban
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
Node.js in a heterogeneous system
Node.js in a heterogeneous systemNode.js in a heterogeneous system
Node.js in a heterogeneous system
 
docker build with Ansible
docker build with Ansibledocker build with Ansible
docker build with Ansible
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
 
Custom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql ReplicationCustom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql Replication
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 

En vedette

Ashley R. White Portfolio 2015
Ashley R. White Portfolio 2015Ashley R. White Portfolio 2015
Ashley R. White Portfolio 2015
Ashley White
 
Хурамшимнай арадай аман зохёолhоо
Хурамшимнай арадай аман зохёолhооХурамшимнай арадай аман зохёолhоо
Хурамшимнай арадай аман зохёолhоо
Зандынова Ольга
 
Geometri analitik bidang lingkaran
Geometri analitik bidang  lingkaran Geometri analitik bidang  lingkaran
Geometri analitik bidang lingkaran
barian11
 
Ulasan kritis bf
Ulasan kritis bfUlasan kritis bf
Ulasan kritis bf
Lee Roy
 

En vedette (10)

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

Similaire à Provisioning with Puppet

From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
Carlos Sanchez
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
garrett honeycutt
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
Carlos Sanchez
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
One click deployment
One click deploymentOne click deployment
One click deployment
Alex Su
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
Carlos Sanchez
 
A Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceA Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conference
ohadlevy
 
Deploying nginx with minimal system resources
Deploying nginx with minimal system resourcesDeploying nginx with minimal system resources
Deploying nginx with minimal system resources
Max Ukhanov
 

Similaire à Provisioning with Puppet (20)

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

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

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