SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Downloaden Sie, um offline zu lesen
Configuration Management
for Development Environments

PuppetConf 22nd September 2011


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/36144637@N00/159627088/
Gareth Rushgrove


gareth rushgrove | morethanseven.net
Work at UK Government Digital Service


gareth rushgrove | morethanseven.net
Blog at morethanseven.net


gareth rushgrove | morethanseven.net
Curate devopsweekly.com


gareth rushgrove | morethanseven.net
Problems


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/iancarroll/5027441664
1. Not all developers want to be sysadmins


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/34652102@N04/5059217055
1. Sysadmins don’t want devs to be sysadmins


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/34652102@N04/5059217055
2. New team members getting started time


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/34652102@N04/5059824808
3. Running a full set of services locally


gareth rushgrove | morethanseven.net        http://www.flickr.com/photos/biggreymare
4. Works on my machine


gareth rushgrove | morethanseven.net
⚡ brew info mysql
      mysql 5.5.14

      $ aptitude show mysql-server
      Package: mysql-server
      State: not installed
      Version: 5.1.41-3ubuntu12.10




Homebrew is great but...


gareth rushgrove | morethanseven.net
23 releases and 21 months in-between 5.1.41 and 5.5.14. Here’s
 some fixed bugs:

 -      An ORDER BY clause was bound to the incorrect substatement
        when used in UNION context.
 -      A NOT IN predicate with a subquery containing a HAVING clause
        could retrieve too many rows, when the subquery itself returned
        NULL.
 -      MIN(year_col) could return an incorrect result in some cases.

 And lots more




What’s a few versions between friends?


gareth rushgrove | morethanseven.net
Spot the cross platform bug (not the security flaw)


gareth rushgrove | morethanseven.net
⚡ ./server.rb &
      ⚡ curl "http://127.0.0.1:8181/?query=Bob"
      ⚡ curl "http://127.0.0.1:8181/?query=bob"
      ⚡ ls




On our Mac


gareth rushgrove | morethanseven.net
⚡ ./server.rb &
      ⚡ curl "http://127.0.0.1:8181/?query=Bob"
      ⚡ curl "http://127.0.0.1:8181/?query=bob"
      ⚡ ls
      Bob
      ⚡ cat Bob
      Hello bob




On our Mac


gareth rushgrove | morethanseven.net
$     ./server.rb &
      $     curl "http://127.0.0.1:8181/?query=Bob"
      $     curl "http://127.0.0.1:8181/?query=bob"
      $     ls




On Linux


gareth rushgrove | morethanseven.net
$ ./server.rb &
      $ curl "http://127.0.0.1:8181/?query=Bob"
      $ curl "http://127.0.0.1:8181/?query=bob"
      $ ls
      Bob bob
      $ cat Bob
      Hello Bob
      $ cat bob
      Hello bob




On Linux


gareth rushgrove | morethanseven.net
Solutions


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/34652102@N04/5059208501
Virtualisation


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/dawilson/2598713027
VirtualBox


gareth rushgrove | morethanseven.net
VMware


gareth rushgrove | morethanseven.net
Virtualisation needs powerful hardware


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/martinoc/477335951
What about editing code?


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/peteradams/2272928740
Shared Folders or NFS


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/34652102@N04/5059846582
Doubledown
Vim


gareth rushgrove | morethanseven.net
Vagrantup.com


gareth rushgrove | morethanseven.net
-      Automated virtual machine creation using Oracle’s VirtualBox
-      Automated provisioning of virtual environments using Chef or Puppet
-      Full SSH access to created environments
-      Assign a static IP to your VM, accessible from your machine
-      Forward ports to the host machine
-      Shared folders allows you to continue using your own editor
-      Package environments into distributable boxes
-      Completely tear down environment when you’re done
-      Easily rebuild a complete environment with a single command


What is Vagrant?


gareth rushgrove | morethanseven.net
Base boxes


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/dawilson/2793319903
VeeWee


gareth rushgrove | morethanseven.net
Community boxes


gareth rushgrove | morethanseven.net
⚡ gem install vagrant
      ⚡ vagrant box add lucid32 http://.../lucid32.box
      ⚡ vagrant init
      ⚡ vagrant up




Vagrant up


gareth rushgrove | morethanseven.net
⚡ ls
   Vagrantfile
   ⚡ vagrant up
   ⚡ vagrant ssh
   ⚡ vagrant reload
   ⚡ vagrant halt
   ⚡ vagrant destroy




Vagrant command line


gareth rushgrove | morethanseven.net
⚡ vagrant ssh-config
   Host default
     HostName 127.0.0.1
     User vagrant
     Port 2222
     IdentityFile /Users/.../vagrant-0.8.2/keys/vagrant
     ...




Export SSH configuration


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
              config.vm.box = "lucid32"
            end




Vagrantfile


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
     config.vm.forward_port("web", 80, 8080)
     config.vm.forward_port("ftp", 21, 4567)
     config.vm.forward_port("ssh", 22, 2222, :auto => true)
   end




Port forwarding


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
     config.vm.share_folder("folder", "/guest", "../host")
   end




Shared folders


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
     config.vm.define :web do |web_config|
       web_config.vm.box = "web"
       web_config.vm.forward_port("http", 80, 8080)
     end

     config.vm.define :db do |db_config|
       db_config.vm.box = "db"
       db_config.vm.forward_port("db", 3306, 3306)
     end
   end




Multiple VMs in one file


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
     config.vm.boot_mode      = :gui
     config.ssh.forward_agent = true
     config.vm.network("33.33.33.10")
     config.vm.customize do |vm|
       vm.memory_size = 512
     end
   end




Lots more options


gareth rushgrove | morethanseven.net
Puppet


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
               config.vm.provision :puppet do |puppet|
                 puppet.manifests_path = "puppetmanifests"
                 puppet.manifest_file = "newbox.pp"
               end
             end




Vagrant provisioning with Puppet


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
               config.vm.provision :puppet_server do |puppet|
                 puppet.puppet_server = "puppet.example.com"
                 puppet.puppet_node   = "vm.example.com"
               end
             end




Vagrant provisioning with Puppetmaster


gareth rushgrove | morethanseven.net
Chef


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
               config.vm.provision :chef_solo do |chef|
                 chef.add_recipe     = "garethr"
                 chef.cookbooks_path = “cookbooks”
               end
             end




Vagrant provisioning with Chef


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
               config.vm.provision :chef_solo do |chef|
                 chef.roles_path = "roles"
                 chef.add_role("vm")
               end
             end




Specifying Chef roles


gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
   config.vm.provision :chef_solo do |chef|
     chef.recipe_url = "http://github.com/cookbooks.tar.gz"
     chef.add_recipe "garethr"
     chef.cookbooks_path = [:vm, "cookbooks"]
     chef.json.merge!({ :garethr => {
       :ohmyzsh => "https://github.com/.../oh-my-zsh.git",
       :dotvim => "https://github.com/garethr/dotvim.git"
     }})
   end
 end



Remote file


gareth rushgrove | morethanseven.net
-      Vagrant Hosts - https://github.com/dwt/vagrant-hosts
-      Sahara - https://github.com/jedi4ever/sahara
-      Vagrantboxes - https://github.com/garethr/ruby-vagrantboxes




Plugins


gareth rushgrove | morethanseven.net                  http://www.flickr.com/photos/s3a/4710416678
⚡ vagrant provision
   [default] Running provisioner:
   Vagrant::Provisioners::Puppet...
   [default] Running Puppet with base.pp...
   [default] notice: /Stage[main]//File[/etc/motd]/
   content: content changed '{md5}
   a10cc0046a5fad11470513e5f5df9d91' to '{md5}
   9e5e449fc643d3e88a2cefeb1af7bc2e'
   [default]
   [default] notice: /Stage[main]//File[/etc/motd]/
   mode: mode changed '777' to '644'


Useful for testing puppet modules


gareth rushgrove | morethanseven.net
Useful for local configuration management


gareth rushgrove | morethanseven.net   http://www.flickr.com/photos/crustyscumbrothersontour/2674351601
-      I want my development environment on my local vms
-      I don’t want a wiki page of instructions
-      I don’t want to have to manually install anything
-      I don’t want to care about destroying a virtual machine




Real world example


gareth rushgrove | morethanseven.net
⚡ tree
   ├── Vagrantfile
   └── modules
       └── garethr
           ├── manifests
           │   └── init.pp
           ├── spec
           │   └── classes
           │        └── base.rv
           │        └── janus.rv
           │        └── ohmyzsh.rv
           └────── spec_helper.rb


Puppet layout


gareth rushgrove | morethanseven.net
class base {
               $packages = ["zsh", "wget", "curl", "lynx",
                          "git-core", "dvtm", “tree”,
                          "build-essential", "vim-nox"]
               package { $packages: ensure => "installed" }
             }




Packages I like


gareth rushgrove | morethanseven.net
$repo = "git://github.com/robbyrussell/oh-my-zsh.git"
      exec { "ohmyzsh":
        command => "git clone ${repo} .oh-my-zsh",
        cwd     => "/home/vagrant",
        creates => "/home/vagrant/.oh-my-zsh",
        require => Class["base"],
      }
      exec { "zshrc":
        command => "cp .... /home/vagrant/.zshrc",
        creates => "/home/vagrant/.zshrc",
        require => Exec["ohmyzsh"],
      }



My Zsh configs


gareth rushgrove | morethanseven.net
$repo = "git://github.com/carlhuda/janus.git"
      exec { "get_janus":
        command => "git clone ${repo} .vim",
        cwd     => "/home/vagrant",
        creates => "/home/vagrant/.vim",
        require => Class["base"],
      }
      exec { "compile_janus":
        command => "rake",
        creates => "/home/vagrant/.zshrc",
        require => Exec["ohmyzsh"],
        environment => "HOME=/home/vagrant",
      }


My Vim configs


gareth rushgrove | morethanseven.net
require 'spec_helper'

              describe 'ohmyzsh', :type => :class do
                it { should create_exec("ohmyzsh") }
                it { should create_exec("zshrc") }
                it { should create_class("base") }
              end




Testing with Rspec


gareth rushgrove | morethanseven.net
base
                  should create Package[zsh]
                  should create Package[vim-nox]
                  should create Package[git-core]

                ohmyzsh
                  should create Exec[ohmyzsh]
                  should create Exec[zshrc]
                  should create Class[base]

                Finished in 1.4 seconds
                10 examples, 0 failures



Rspec results


gareth rushgrove | morethanseven.net
-      Using Virtualisation makes getting started fast
-      Running the same platform catches bugs early
-      Using Vagrant makes managing virtual machines easy
-      Writing configuration as code makes it testable




Conclusions


gareth rushgrove | morethanseven.net
-      IRC - #vagrant on Freenode
-      Github Issues - https://github.com/mitchellh/vagrant/issues
-      Google Groups - http://groups.google.com/group/vagrant-up




More information on Vagrant


gareth rushgrove | morethanseven.net
Questions?


gareth rushgrove | morethanseven.net   http://flickr.com/photos/psd/102332391/

Weitere ähnliche Inhalte

Was ist angesagt?

Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 
Cloud focker を試してみた public
Cloud focker を試してみた   publicCloud focker を試してみた   public
Cloud focker を試してみた public
Takehiko Amano
 

Was ist angesagt? (20)

Html5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglHtml5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webgl
 
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Transforming WebSockets
Transforming WebSocketsTransforming WebSockets
Transforming WebSockets
 
Single page apps with drupal 7
Single page apps with drupal 7Single page apps with drupal 7
Single page apps with drupal 7
 
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with Hugo
 
Shift Remote: JS - Node.js Scalability Tips - Luciano Mammino (FabFitFun)
Shift Remote: JS - Node.js Scalability Tips - Luciano Mammino (FabFitFun)Shift Remote: JS - Node.js Scalability Tips - Luciano Mammino (FabFitFun)
Shift Remote: JS - Node.js Scalability Tips - Luciano Mammino (FabFitFun)
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Cloud focker を試してみた public
Cloud focker を試してみた   publicCloud focker を試してみた   public
Cloud focker を試してみた public
 
Real Time Event Dispatcher
Real Time Event DispatcherReal Time Event Dispatcher
Real Time Event Dispatcher
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
 
Node.js: scalability tips
Node.js: scalability tipsNode.js: scalability tips
Node.js: scalability tips
 
Cooking Up Drama - ChefConf 2015
Cooking Up Drama - ChefConf 2015 Cooking Up Drama - ChefConf 2015
Cooking Up Drama - ChefConf 2015
 
Cooking Up Drama
Cooking Up DramaCooking Up Drama
Cooking Up Drama
 
Real-Time Web Apps & Symfony. What are your options?
Real-Time Web Apps & Symfony. What are your options?Real-Time Web Apps & Symfony. What are your options?
Real-Time Web Apps & Symfony. What are your options?
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
 

Andere mochten auch

PuppetConf at a glance
PuppetConf at a glancePuppetConf at a glance
PuppetConf at a glance
Puppet
 
Eclipse con 2012 - Devops - Luke Kanies
Eclipse con 2012 - Devops - Luke KaniesEclipse con 2012 - Devops - Luke Kanies
Eclipse con 2012 - Devops - Luke Kanies
Puppet
 

Andere mochten auch (9)

Automating Life in the Cloud - PuppetCamp Chicago '12
Automating Life in the Cloud - PuppetCamp Chicago '12Automating Life in the Cloud - PuppetCamp Chicago '12
Automating Life in the Cloud - PuppetCamp Chicago '12
 
PuppetConf at a glance
PuppetConf at a glancePuppetConf at a glance
PuppetConf at a glance
 
Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
 
State of the Puppet Community (Jan 2013)
State of the Puppet Community (Jan 2013)State of the Puppet Community (Jan 2013)
State of the Puppet Community (Jan 2013)
 
It Automation: Doing it Wrong - Mykel Alvis
It Automation: Doing it Wrong - Mykel AlvisIt Automation: Doing it Wrong - Mykel Alvis
It Automation: Doing it Wrong - Mykel Alvis
 
Eclipse con 2012 - Devops - Luke Kanies
Eclipse con 2012 - Devops - Luke KaniesEclipse con 2012 - Devops - Luke Kanies
Eclipse con 2012 - Devops - Luke Kanies
 
Whirr dev-up-puppetconf2011
Whirr dev-up-puppetconf2011Whirr dev-up-puppetconf2011
Whirr dev-up-puppetconf2011
 
Stanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet ModulesStanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet Modules
 
Hacking The Data out of Puppet - PuppetConf '12
Hacking The Data out of Puppet - PuppetConf '12Hacking The Data out of Puppet - PuppetConf '12
Hacking The Data out of Puppet - PuppetConf '12
 

Ähnlich wie Config managament for development environments iii

Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
tomcopeland
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 

Ähnlich wie Config managament for development environments iii (20)

Config managament for development environments ii
Config managament for development environments iiConfig managament for development environments ii
Config managament for development environments ii
 
Puppet Data Mining
Puppet Data MiningPuppet Data Mining
Puppet Data Mining
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
You're Going To Need A Bigger Toolbox
You're Going To Need A Bigger ToolboxYou're Going To Need A Bigger Toolbox
You're Going To Need A Bigger Toolbox
 
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
 
Devops
DevopsDevops
Devops
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
 
vagrant-php
vagrant-phpvagrant-php
vagrant-php
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
FreeBSD: Dev to Prod
FreeBSD: Dev to ProdFreeBSD: Dev to Prod
FreeBSD: Dev to Prod
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
 
Geeky Academy Week 3 :: Vagrant + Puppet
Geeky Academy Week 3 :: Vagrant + PuppetGeeky Academy Week 3 :: Vagrant + Puppet
Geeky Academy Week 3 :: Vagrant + Puppet
 
Metrics with Ganglia
Metrics with GangliaMetrics with Ganglia
Metrics with Ganglia
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
Lights, Camera, Docker: Streaming Video at DramaFever
Lights, Camera, Docker: Streaming Video at DramaFeverLights, Camera, Docker: Streaming Video at DramaFever
Lights, Camera, Docker: Streaming Video at DramaFever
 
Vagrant & Reusable Code
Vagrant & Reusable CodeVagrant & Reusable Code
Vagrant & Reusable Code
 
EC2
EC2EC2
EC2
 

Mehr von Puppet

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
Puppet
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)
Puppet
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
Puppet
 

Mehr von Puppet (20)

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyaml
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscode
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance code
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approach
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliance
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNow
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden Windows
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael Pinson
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping ground
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User Group
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOps
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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...
 

Config managament for development environments iii

  • 1. Configuration Management for Development Environments PuppetConf 22nd September 2011 gareth rushgrove | morethanseven.net http://www.flickr.com/photos/36144637@N00/159627088/
  • 2. Gareth Rushgrove gareth rushgrove | morethanseven.net
  • 3. Work at UK Government Digital Service gareth rushgrove | morethanseven.net
  • 4. Blog at morethanseven.net gareth rushgrove | morethanseven.net
  • 6. Problems gareth rushgrove | morethanseven.net http://www.flickr.com/photos/iancarroll/5027441664
  • 7. 1. Not all developers want to be sysadmins gareth rushgrove | morethanseven.net http://www.flickr.com/photos/34652102@N04/5059217055
  • 8. 1. Sysadmins don’t want devs to be sysadmins gareth rushgrove | morethanseven.net http://www.flickr.com/photos/34652102@N04/5059217055
  • 9. 2. New team members getting started time gareth rushgrove | morethanseven.net http://www.flickr.com/photos/34652102@N04/5059824808
  • 10. 3. Running a full set of services locally gareth rushgrove | morethanseven.net http://www.flickr.com/photos/biggreymare
  • 11. 4. Works on my machine gareth rushgrove | morethanseven.net
  • 12. ⚡ brew info mysql mysql 5.5.14 $ aptitude show mysql-server Package: mysql-server State: not installed Version: 5.1.41-3ubuntu12.10 Homebrew is great but... gareth rushgrove | morethanseven.net
  • 13. 23 releases and 21 months in-between 5.1.41 and 5.5.14. Here’s some fixed bugs: - An ORDER BY clause was bound to the incorrect substatement when used in UNION context. - A NOT IN predicate with a subquery containing a HAVING clause could retrieve too many rows, when the subquery itself returned NULL. - MIN(year_col) could return an incorrect result in some cases. And lots more What’s a few versions between friends? gareth rushgrove | morethanseven.net
  • 14. Spot the cross platform bug (not the security flaw) gareth rushgrove | morethanseven.net
  • 15. ⚡ ./server.rb & ⚡ curl "http://127.0.0.1:8181/?query=Bob" ⚡ curl "http://127.0.0.1:8181/?query=bob" ⚡ ls On our Mac gareth rushgrove | morethanseven.net
  • 16. ⚡ ./server.rb & ⚡ curl "http://127.0.0.1:8181/?query=Bob" ⚡ curl "http://127.0.0.1:8181/?query=bob" ⚡ ls Bob ⚡ cat Bob Hello bob On our Mac gareth rushgrove | morethanseven.net
  • 17. $ ./server.rb & $ curl "http://127.0.0.1:8181/?query=Bob" $ curl "http://127.0.0.1:8181/?query=bob" $ ls On Linux gareth rushgrove | morethanseven.net
  • 18. $ ./server.rb & $ curl "http://127.0.0.1:8181/?query=Bob" $ curl "http://127.0.0.1:8181/?query=bob" $ ls Bob bob $ cat Bob Hello Bob $ cat bob Hello bob On Linux gareth rushgrove | morethanseven.net
  • 19. Solutions gareth rushgrove | morethanseven.net http://www.flickr.com/photos/34652102@N04/5059208501
  • 20. Virtualisation gareth rushgrove | morethanseven.net http://www.flickr.com/photos/dawilson/2598713027
  • 21. VirtualBox gareth rushgrove | morethanseven.net
  • 22. VMware gareth rushgrove | morethanseven.net
  • 23. Virtualisation needs powerful hardware gareth rushgrove | morethanseven.net http://www.flickr.com/photos/martinoc/477335951
  • 24. What about editing code? gareth rushgrove | morethanseven.net http://www.flickr.com/photos/peteradams/2272928740
  • 25. Shared Folders or NFS gareth rushgrove | morethanseven.net http://www.flickr.com/photos/34652102@N04/5059846582
  • 27. Vim gareth rushgrove | morethanseven.net
  • 28. Vagrantup.com gareth rushgrove | morethanseven.net
  • 29. - Automated virtual machine creation using Oracle’s VirtualBox - Automated provisioning of virtual environments using Chef or Puppet - Full SSH access to created environments - Assign a static IP to your VM, accessible from your machine - Forward ports to the host machine - Shared folders allows you to continue using your own editor - Package environments into distributable boxes - Completely tear down environment when you’re done - Easily rebuild a complete environment with a single command What is Vagrant? gareth rushgrove | morethanseven.net
  • 30. Base boxes gareth rushgrove | morethanseven.net http://www.flickr.com/photos/dawilson/2793319903
  • 31. VeeWee gareth rushgrove | morethanseven.net
  • 32. Community boxes gareth rushgrove | morethanseven.net
  • 33. ⚡ gem install vagrant ⚡ vagrant box add lucid32 http://.../lucid32.box ⚡ vagrant init ⚡ vagrant up Vagrant up gareth rushgrove | morethanseven.net
  • 34. ⚡ ls Vagrantfile ⚡ vagrant up ⚡ vagrant ssh ⚡ vagrant reload ⚡ vagrant halt ⚡ vagrant destroy Vagrant command line gareth rushgrove | morethanseven.net
  • 35. ⚡ vagrant ssh-config Host default HostName 127.0.0.1 User vagrant Port 2222 IdentityFile /Users/.../vagrant-0.8.2/keys/vagrant ... Export SSH configuration gareth rushgrove | morethanseven.net
  • 36. Vagrant::Config.run do |config| config.vm.box = "lucid32" end Vagrantfile gareth rushgrove | morethanseven.net
  • 37. Vagrant::Config.run do |config| config.vm.forward_port("web", 80, 8080) config.vm.forward_port("ftp", 21, 4567) config.vm.forward_port("ssh", 22, 2222, :auto => true) end Port forwarding gareth rushgrove | morethanseven.net
  • 38. Vagrant::Config.run do |config| config.vm.share_folder("folder", "/guest", "../host") end Shared folders gareth rushgrove | morethanseven.net
  • 39. Vagrant::Config.run do |config| config.vm.define :web do |web_config| web_config.vm.box = "web" web_config.vm.forward_port("http", 80, 8080) end config.vm.define :db do |db_config| db_config.vm.box = "db" db_config.vm.forward_port("db", 3306, 3306) end end Multiple VMs in one file gareth rushgrove | morethanseven.net
  • 40. Vagrant::Config.run do |config| config.vm.boot_mode = :gui config.ssh.forward_agent = true config.vm.network("33.33.33.10") config.vm.customize do |vm| vm.memory_size = 512 end end Lots more options gareth rushgrove | morethanseven.net
  • 41. Puppet gareth rushgrove | morethanseven.net
  • 42. Vagrant::Config.run do |config| config.vm.provision :puppet do |puppet| puppet.manifests_path = "puppetmanifests" puppet.manifest_file = "newbox.pp" end end Vagrant provisioning with Puppet gareth rushgrove | morethanseven.net
  • 43. Vagrant::Config.run do |config| config.vm.provision :puppet_server do |puppet| puppet.puppet_server = "puppet.example.com" puppet.puppet_node = "vm.example.com" end end Vagrant provisioning with Puppetmaster gareth rushgrove | morethanseven.net
  • 44. Chef gareth rushgrove | morethanseven.net
  • 45. Vagrant::Config.run do |config| config.vm.provision :chef_solo do |chef| chef.add_recipe = "garethr" chef.cookbooks_path = “cookbooks” end end Vagrant provisioning with Chef gareth rushgrove | morethanseven.net
  • 46. Vagrant::Config.run do |config| config.vm.provision :chef_solo do |chef| chef.roles_path = "roles" chef.add_role("vm") end end Specifying Chef roles gareth rushgrove | morethanseven.net
  • 47. Vagrant::Config.run do |config| config.vm.provision :chef_solo do |chef| chef.recipe_url = "http://github.com/cookbooks.tar.gz" chef.add_recipe "garethr" chef.cookbooks_path = [:vm, "cookbooks"] chef.json.merge!({ :garethr => { :ohmyzsh => "https://github.com/.../oh-my-zsh.git", :dotvim => "https://github.com/garethr/dotvim.git" }}) end end Remote file gareth rushgrove | morethanseven.net
  • 48. - Vagrant Hosts - https://github.com/dwt/vagrant-hosts - Sahara - https://github.com/jedi4ever/sahara - Vagrantboxes - https://github.com/garethr/ruby-vagrantboxes Plugins gareth rushgrove | morethanseven.net http://www.flickr.com/photos/s3a/4710416678
  • 49. ⚡ vagrant provision [default] Running provisioner: Vagrant::Provisioners::Puppet... [default] Running Puppet with base.pp... [default] notice: /Stage[main]//File[/etc/motd]/ content: content changed '{md5} a10cc0046a5fad11470513e5f5df9d91' to '{md5} 9e5e449fc643d3e88a2cefeb1af7bc2e' [default] [default] notice: /Stage[main]//File[/etc/motd]/ mode: mode changed '777' to '644' Useful for testing puppet modules gareth rushgrove | morethanseven.net
  • 50. Useful for local configuration management gareth rushgrove | morethanseven.net http://www.flickr.com/photos/crustyscumbrothersontour/2674351601
  • 51. - I want my development environment on my local vms - I don’t want a wiki page of instructions - I don’t want to have to manually install anything - I don’t want to care about destroying a virtual machine Real world example gareth rushgrove | morethanseven.net
  • 52. ⚡ tree ├── Vagrantfile └── modules └── garethr ├── manifests │   └── init.pp ├── spec │   └── classes │   └── base.rv │   └── janus.rv │   └── ohmyzsh.rv └────── spec_helper.rb Puppet layout gareth rushgrove | morethanseven.net
  • 53. class base { $packages = ["zsh", "wget", "curl", "lynx", "git-core", "dvtm", “tree”, "build-essential", "vim-nox"] package { $packages: ensure => "installed" } } Packages I like gareth rushgrove | morethanseven.net
  • 54. $repo = "git://github.com/robbyrussell/oh-my-zsh.git" exec { "ohmyzsh": command => "git clone ${repo} .oh-my-zsh", cwd => "/home/vagrant", creates => "/home/vagrant/.oh-my-zsh", require => Class["base"], } exec { "zshrc": command => "cp .... /home/vagrant/.zshrc", creates => "/home/vagrant/.zshrc", require => Exec["ohmyzsh"], } My Zsh configs gareth rushgrove | morethanseven.net
  • 55. $repo = "git://github.com/carlhuda/janus.git" exec { "get_janus": command => "git clone ${repo} .vim", cwd => "/home/vagrant", creates => "/home/vagrant/.vim", require => Class["base"], } exec { "compile_janus": command => "rake", creates => "/home/vagrant/.zshrc", require => Exec["ohmyzsh"], environment => "HOME=/home/vagrant", } My Vim configs gareth rushgrove | morethanseven.net
  • 56. require 'spec_helper' describe 'ohmyzsh', :type => :class do it { should create_exec("ohmyzsh") } it { should create_exec("zshrc") } it { should create_class("base") } end Testing with Rspec gareth rushgrove | morethanseven.net
  • 57. base should create Package[zsh] should create Package[vim-nox] should create Package[git-core] ohmyzsh should create Exec[ohmyzsh] should create Exec[zshrc] should create Class[base] Finished in 1.4 seconds 10 examples, 0 failures Rspec results gareth rushgrove | morethanseven.net
  • 58. - Using Virtualisation makes getting started fast - Running the same platform catches bugs early - Using Vagrant makes managing virtual machines easy - Writing configuration as code makes it testable Conclusions gareth rushgrove | morethanseven.net
  • 59. - IRC - #vagrant on Freenode - Github Issues - https://github.com/mitchellh/vagrant/issues - Google Groups - http://groups.google.com/group/vagrant-up More information on Vagrant gareth rushgrove | morethanseven.net
  • 60. Questions? gareth rushgrove | morethanseven.net http://flickr.com/photos/psd/102332391/