Standardized Debugging Environments
Taking the Friction Out of Ticket Investigation
Charlie Sharpsteen Open Source Support Engineer, Puppet Labs
What Are We Trying to Improve?
Collaboration Across Groups…
Collaboration Across Groups…
Support
Collaboration Across Groups…
Support Engineering
Collaboration Across Groups…
Support Engineering Users
Collaboration Across Groups…
…and Across Environments
Support Engineering Users
Collaboration Across Groups…
…and Across Environments
Support Engineering Users
Windows Linux
Collaboration Across Groups…
…and Across Environments
Support Engineering Users
Windows LinuxOS X Solaris
What I cannot create, I do not understand.
- Richard Feynmen
First Steps
First Steps
• Hand-built VMs
First Steps
• Hand-built VMs
• Manually managed snapshots
First Steps
• Hand-built VMs
• Manually managed snapshots
• Hard to scale out and manually manage many VMs
Enter Vagrant
Enter Vagrant
• A tool that allows us to create and manage many VM instances
Enter Vagrant
• A tool that allows us to create and manage many VM instances
• Manages artifacts required to use multiple guest operating systems
• Provisions VMs after creation
Enter Vagrant
• A tool that allows us to create and manage many VM instances
• Manages artifacts required to use multiple guest operating systems
• Provisions VMs after creation
• Each VM is specified in a plain text file
# -*- mode: ruby -*-!# vi: set ft=ruby :!!!# Hashes of box URLs!S3_BOXES = {! :sles_11sp1 => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210.box',! :sles_11sp1_nocm => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210-nocm.box',! :fedora_18 => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box',! :fedora_18_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box',! :centos_59 => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210.box',! :centos_59_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box',! :centos_64_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box',! :centos_64_fusion_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box',! :debian_6_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box',! :debian_7 => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210.box',! :debian_7_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box',! :ubuntu_1204_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box',!}!!LOCAL_BOXES = {! :centos_64_pe => "~/Data/boxes/centos-6.4-i386-pe.box",! :solaris_10 => '~/Data/boxes/solaris-10u11-i386-vbox4210.box',! :solaris_10_nocm => '~/Data/boxes/solaris-10u11-i386-vbox4210-nocm.box',!}!!BOOTSTRAPS = {! :centos_6 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing EPEL'! wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm! wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm! sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm!! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :centos_59 => <<-EOS,!# CentOS 5 has some networking problems!/etc/init.d/network restart!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/5/products/x86_64/puppetlabs-release-5-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :ubuntu_1204 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! wget --output-document=/tmp/puppet-repo-precise.deb http://apt.puppetlabs.com/puppetlabs-release-precise.deb! dpkg -i /tmp/puppet-repo-precise.deb! apt-get update! apt-get install -y --allow-unauthenticated puppet!fi! EOS! :fedora_18 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! sudo rpm -ivh http://yum.puppetlabs.com/fedora/f18/products/i386/puppetlabs-release-18-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS!}!!# Shorthand method for setting box URL and name in one shot.!def set_box box, box_url! box.vm.box_url = box_url! # Recover box name from url by returning the last component minus the! # `.box` extension.! box.vm.box = File.basename(box.vm.box_url, File.extname(box.vm.box_url))!end!!def share_puppet_source box! box.vm.share_folder 'puppet-source', '/puppetlabs', "#{ENV['HOME']}/Source/puppetlabs"!end!!def share_puppet_modules box! box.vm.share_folder 'puppet-modules', '/usr/share/puppet/modules', 'provisioning/modules'!end!!def provision_box box, manifest! box.vm.provision :puppet do |puppet|! puppet.pp_path = '/tmp/vagrant-puppet'! puppet.manifests_path = 'provisioning/manifests'! puppet.module_path = 'provisioning/modules'! puppet.manifest_file = manifest! end!end!!
!!Vagrant::Config.run do |config|! config.ssh.forward_x11 = true!! config.vm.define :pemaster do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.40"! box.vm.host_name = 'pemaster.boxnet'! end!! config.vm.define :peagent do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.41"! box.vm.host_name = 'peagent.boxnet'! end!!! config.vm.define :puppetmaster do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.20"! box.vm.host_name = 'puppetmaster.boxnet'!! # NOTE: Share folders, such as Git checkouts of the Puppet source code! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'server.pp'! end!! config.vm.define :puppetagent do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! box.vm.network :hostonly, "192.168.23.21"! box.vm.host_name = "puppetagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :centos_59 do |box|! flavor = :centos_59_nocm! set_box box, S3_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.22"! box.vm.host_name = "centos-59.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[:centos_59]! provision_box box, 'agent.pp'! end!! config.vm.define :ubuntuagent do |box|! flavor = :ubuntu_1204! set_box box, S3_BOXES[:ubuntu_1204_nocm]!! box.vm.network :hostonly, "192.168.23.23"! box.vm.host_name = "ubuntuagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :solaris_10 do |box|! box.vm.guest = :solaris! flavor = :solaris_10! set_box box, LOCAL_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.24"! box.vm.host_name = "solaris-10.boxnet"! end!! config.vm.define :debianagent do |box|! flavor = :debian_7_nocm! set_box box, S3_BOXES[flavor]!!
The uberVagrantfile
# -*- mode: ruby -*-!# vi: set ft=ruby :!!!# Hashes of box URLs!S3_BOXES = {! :sles_11sp1 => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210.box',! :sles_11sp1_nocm => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210-nocm.box',! :fedora_18 => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box',! :fedora_18_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box',! :centos_59 => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210.box',! :centos_59_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box',! :centos_64_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box',! :centos_64_fusion_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box',! :debian_6_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box',! :debian_7 => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210.box',! :debian_7_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box',! :ubuntu_1204_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box',!}!!LOCAL_BOXES = {! :centos_64_pe => "~/Data/boxes/centos-6.4-i386-pe.box",! :solaris_10 => '~/Data/boxes/solaris-10u11-i386-vbox4210.box',! :solaris_10_nocm => '~/Data/boxes/solaris-10u11-i386-vbox4210-nocm.box',!}!!BOOTSTRAPS = {! :centos_6 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing EPEL'! wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm! wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm! sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm!! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :centos_59 => <<-EOS,!# CentOS 5 has some networking problems!/etc/init.d/network restart!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/5/products/x86_64/puppetlabs-release-5-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :ubuntu_1204 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! wget --output-document=/tmp/puppet-repo-precise.deb http://apt.puppetlabs.com/puppetlabs-release-precise.deb! dpkg -i /tmp/puppet-repo-precise.deb! apt-get update! apt-get install -y --allow-unauthenticated puppet!fi! EOS! :fedora_18 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! sudo rpm -ivh http://yum.puppetlabs.com/fedora/f18/products/i386/puppetlabs-release-18-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS!}!!# Shorthand method for setting box URL and name in one shot.!def set_box box, box_url! box.vm.box_url = box_url! # Recover box name from url by returning the last component minus the! # `.box` extension.! box.vm.box = File.basename(box.vm.box_url, File.extname(box.vm.box_url))!end!!def share_puppet_source box! box.vm.share_folder 'puppet-source', '/puppetlabs', "#{ENV['HOME']}/Source/puppetlabs"!end!!def share_puppet_modules box! box.vm.share_folder 'puppet-modules', '/usr/share/puppet/modules', 'provisioning/modules'!end!!def provision_box box, manifest! box.vm.provision :puppet do |puppet|! puppet.pp_path = '/tmp/vagrant-puppet'! puppet.manifests_path = 'provisioning/manifests'! puppet.module_path = 'provisioning/modules'! puppet.manifest_file = manifest! end!end!!
!!Vagrant::Config.run do |config|! config.ssh.forward_x11 = true!! config.vm.define :pemaster do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.40"! box.vm.host_name = 'pemaster.boxnet'! end!! config.vm.define :peagent do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.41"! box.vm.host_name = 'peagent.boxnet'! end!!! config.vm.define :puppetmaster do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.20"! box.vm.host_name = 'puppetmaster.boxnet'!! # NOTE: Share folders, such as Git checkouts of the Puppet source code! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'server.pp'! end!! config.vm.define :puppetagent do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! box.vm.network :hostonly, "192.168.23.21"! box.vm.host_name = "puppetagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :centos_59 do |box|! flavor = :centos_59_nocm! set_box box, S3_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.22"! box.vm.host_name = "centos-59.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[:centos_59]! provision_box box, 'agent.pp'! end!! config.vm.define :ubuntuagent do |box|! flavor = :ubuntu_1204! set_box box, S3_BOXES[:ubuntu_1204_nocm]!! box.vm.network :hostonly, "192.168.23.23"! box.vm.host_name = "ubuntuagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :solaris_10 do |box|! box.vm.guest = :solaris! flavor = :solaris_10! set_box box, LOCAL_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.24"! box.vm.host_name = "solaris-10.boxnet"! end!! config.vm.define :debianagent do |box|! flavor = :debian_7_nocm! set_box box, S3_BOXES[flavor]!!
The uberVagrantfileData: !# Hashes of box URLs!S3_BOXES = {! :sles_11sp1 => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210.box',! :sles_11sp1_nocm => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210-nocm.box',! :fedora_18 => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box',! :fedora_18_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box',! :centos_59 => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210.box',! :centos_59_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box',! :centos_64_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box',! :centos_64_fusion_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box',! :debian_6_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box',! :debian_7 => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210.box',! :debian_7_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box',! :ubuntu_1204_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box',!}!
# -*- mode: ruby -*-!# vi: set ft=ruby :!!!# Hashes of box URLs!S3_BOXES = {! :sles_11sp1 => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210.box',! :sles_11sp1_nocm => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210-nocm.box',! :fedora_18 => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box',! :fedora_18_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box',! :centos_59 => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210.box',! :centos_59_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box',! :centos_64_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box',! :centos_64_fusion_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box',! :debian_6_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box',! :debian_7 => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210.box',! :debian_7_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box',! :ubuntu_1204_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box',!}!!LOCAL_BOXES = {! :centos_64_pe => "~/Data/boxes/centos-6.4-i386-pe.box",! :solaris_10 => '~/Data/boxes/solaris-10u11-i386-vbox4210.box',! :solaris_10_nocm => '~/Data/boxes/solaris-10u11-i386-vbox4210-nocm.box',!}!!BOOTSTRAPS = {! :centos_6 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing EPEL'! wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm! wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm! sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm!! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :centos_59 => <<-EOS,!# CentOS 5 has some networking problems!/etc/init.d/network restart!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/5/products/x86_64/puppetlabs-release-5-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :ubuntu_1204 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! wget --output-document=/tmp/puppet-repo-precise.deb http://apt.puppetlabs.com/puppetlabs-release-precise.deb! dpkg -i /tmp/puppet-repo-precise.deb! apt-get update! apt-get install -y --allow-unauthenticated puppet!fi! EOS! :fedora_18 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! sudo rpm -ivh http://yum.puppetlabs.com/fedora/f18/products/i386/puppetlabs-release-18-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS!}!!# Shorthand method for setting box URL and name in one shot.!def set_box box, box_url! box.vm.box_url = box_url! # Recover box name from url by returning the last component minus the! # `.box` extension.! box.vm.box = File.basename(box.vm.box_url, File.extname(box.vm.box_url))!end!!def share_puppet_source box! box.vm.share_folder 'puppet-source', '/puppetlabs', "#{ENV['HOME']}/Source/puppetlabs"!end!!def share_puppet_modules box! box.vm.share_folder 'puppet-modules', '/usr/share/puppet/modules', 'provisioning/modules'!end!!def provision_box box, manifest! box.vm.provision :puppet do |puppet|! puppet.pp_path = '/tmp/vagrant-puppet'! puppet.manifests_path = 'provisioning/manifests'! puppet.module_path = 'provisioning/modules'! puppet.manifest_file = manifest! end!end!!
!!Vagrant::Config.run do |config|! config.ssh.forward_x11 = true!! config.vm.define :pemaster do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.40"! box.vm.host_name = 'pemaster.boxnet'! end!! config.vm.define :peagent do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.41"! box.vm.host_name = 'peagent.boxnet'! end!!! config.vm.define :puppetmaster do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.20"! box.vm.host_name = 'puppetmaster.boxnet'!! # NOTE: Share folders, such as Git checkouts of the Puppet source code! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'server.pp'! end!! config.vm.define :puppetagent do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! box.vm.network :hostonly, "192.168.23.21"! box.vm.host_name = "puppetagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :centos_59 do |box|! flavor = :centos_59_nocm! set_box box, S3_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.22"! box.vm.host_name = "centos-59.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[:centos_59]! provision_box box, 'agent.pp'! end!! config.vm.define :ubuntuagent do |box|! flavor = :ubuntu_1204! set_box box, S3_BOXES[:ubuntu_1204_nocm]!! box.vm.network :hostonly, "192.168.23.23"! box.vm.host_name = "ubuntuagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :solaris_10 do |box|! box.vm.guest = :solaris! flavor = :solaris_10! set_box box, LOCAL_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.24"! box.vm.host_name = "solaris-10.boxnet"! end!! config.vm.define :debianagent do |box|! flavor = :debian_7_nocm! set_box box, S3_BOXES[flavor]!!
The uberVagrantfileCustom Provisioners: !BOOTSTRAPS = {! :centos_6 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing EPEL'! wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm! wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm! sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm!! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS!...!!def provision_box box, manifest! box.vm.provision :puppet do |puppet|! puppet.pp_path = '/tmp/vagrant-puppet'! puppet.manifests_path = 'provisioning/manifests'! puppet.module_path = 'provisioning/modules'! puppet.manifest_file = manifest! end!end
# -*- mode: ruby -*-!# vi: set ft=ruby :!!!# Hashes of box URLs!S3_BOXES = {! :sles_11sp1 => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210.box',! :sles_11sp1_nocm => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210-nocm.box',! :fedora_18 => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box',! :fedora_18_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box',! :centos_59 => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210.box',! :centos_59_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box',! :centos_64_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box',! :centos_64_fusion_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box',! :debian_6_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box',! :debian_7 => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210.box',! :debian_7_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box',! :ubuntu_1204_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box',!}!!LOCAL_BOXES = {! :centos_64_pe => "~/Data/boxes/centos-6.4-i386-pe.box",! :solaris_10 => '~/Data/boxes/solaris-10u11-i386-vbox4210.box',! :solaris_10_nocm => '~/Data/boxes/solaris-10u11-i386-vbox4210-nocm.box',!}!!BOOTSTRAPS = {! :centos_6 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing EPEL'! wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm! wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm! sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm!! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :centos_59 => <<-EOS,!# CentOS 5 has some networking problems!/etc/init.d/network restart!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/5/products/x86_64/puppetlabs-release-5-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :ubuntu_1204 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! wget --output-document=/tmp/puppet-repo-precise.deb http://apt.puppetlabs.com/puppetlabs-release-precise.deb! dpkg -i /tmp/puppet-repo-precise.deb! apt-get update! apt-get install -y --allow-unauthenticated puppet!fi! EOS! :fedora_18 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! sudo rpm -ivh http://yum.puppetlabs.com/fedora/f18/products/i386/puppetlabs-release-18-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS!}!!# Shorthand method for setting box URL and name in one shot.!def set_box box, box_url! box.vm.box_url = box_url! # Recover box name from url by returning the last component minus the! # `.box` extension.! box.vm.box = File.basename(box.vm.box_url, File.extname(box.vm.box_url))!end!!def share_puppet_source box! box.vm.share_folder 'puppet-source', '/puppetlabs', "#{ENV['HOME']}/Source/puppetlabs"!end!!def share_puppet_modules box! box.vm.share_folder 'puppet-modules', '/usr/share/puppet/modules', 'provisioning/modules'!end!!def provision_box box, manifest! box.vm.provision :puppet do |puppet|! puppet.pp_path = '/tmp/vagrant-puppet'! puppet.manifests_path = 'provisioning/manifests'! puppet.module_path = 'provisioning/modules'! puppet.manifest_file = manifest! end!end!!
!!Vagrant::Config.run do |config|! config.ssh.forward_x11 = true!! config.vm.define :pemaster do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.40"! box.vm.host_name = 'pemaster.boxnet'! end!! config.vm.define :peagent do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.41"! box.vm.host_name = 'peagent.boxnet'! end!!! config.vm.define :puppetmaster do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.20"! box.vm.host_name = 'puppetmaster.boxnet'!! # NOTE: Share folders, such as Git checkouts of the Puppet source code! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'server.pp'! end!! config.vm.define :puppetagent do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! box.vm.network :hostonly, "192.168.23.21"! box.vm.host_name = "puppetagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :centos_59 do |box|! flavor = :centos_59_nocm! set_box box, S3_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.22"! box.vm.host_name = "centos-59.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[:centos_59]! provision_box box, 'agent.pp'! end!! config.vm.define :ubuntuagent do |box|! flavor = :ubuntu_1204! set_box box, S3_BOXES[:ubuntu_1204_nocm]!! box.vm.network :hostonly, "192.168.23.23"! box.vm.host_name = "ubuntuagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :solaris_10 do |box|! box.vm.guest = :solaris! flavor = :solaris_10! set_box box, LOCAL_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.24"! box.vm.host_name = "solaris-10.boxnet"! end!! config.vm.define :debianagent do |box|! flavor = :debian_7_nocm! set_box box, S3_BOXES[flavor]!!
The uberVagrantfileVM Definitions ! config.vm.define :pemaster do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.40"! box.vm.host_name = 'pemaster.boxnet'! end!! config.vm.define :peagent do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.41"! box.vm.host_name = 'peagent.boxnet'! end
# -*- mode: ruby -*-!# vi: set ft=ruby :!!!# Hashes of box URLs!S3_BOXES = {! :sles_11sp1 => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210.box',! :sles_11sp1_nocm => 'http://puppet-vagrant-boxes.s3.amazonaws.com/sles-11sp1-x64-vbox4210-nocm.box',! :fedora_18 => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box',! :fedora_18_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box',! :centos_59 => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210.box',! :centos_59_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box',! :centos_64_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box',! :centos_64_fusion_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box',! :debian_6_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box',! :debian_7 => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210.box',! :debian_7_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box',! :ubuntu_1204_nocm => 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box',!}!!LOCAL_BOXES = {! :centos_64_pe => "~/Data/boxes/centos-6.4-i386-pe.box",! :solaris_10 => '~/Data/boxes/solaris-10u11-i386-vbox4210.box',! :solaris_10_nocm => '~/Data/boxes/solaris-10u11-i386-vbox4210-nocm.box',!}!!BOOTSTRAPS = {! :centos_6 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing EPEL'! wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm! wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm! sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm!! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :centos_59 => <<-EOS,!# CentOS 5 has some networking problems!/etc/init.d/network restart!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! echo 'Installing Puppet.'! rpm -ivh http://yum.puppetlabs.com/el/5/products/x86_64/puppetlabs-release-5-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS! :ubuntu_1204 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! wget --output-document=/tmp/puppet-repo-precise.deb http://apt.puppetlabs.com/puppetlabs-release-precise.deb! dpkg -i /tmp/puppet-repo-precise.deb! apt-get update! apt-get install -y --allow-unauthenticated puppet!fi! EOS! :fedora_18 => <<-EOS,!if which puppet > /dev/null 2>&1; then! echo 'Puppet Installed.'!else! sudo rpm -ivh http://yum.puppetlabs.com/fedora/f18/products/i386/puppetlabs-release-18-7.noarch.rpm! yum --nogpgcheck -y install puppet-server!fi! EOS!}!!# Shorthand method for setting box URL and name in one shot.!def set_box box, box_url! box.vm.box_url = box_url! # Recover box name from url by returning the last component minus the! # `.box` extension.! box.vm.box = File.basename(box.vm.box_url, File.extname(box.vm.box_url))!end!!def share_puppet_source box! box.vm.share_folder 'puppet-source', '/puppetlabs', "#{ENV['HOME']}/Source/puppetlabs"!end!!def share_puppet_modules box! box.vm.share_folder 'puppet-modules', '/usr/share/puppet/modules', 'provisioning/modules'!end!!def provision_box box, manifest! box.vm.provision :puppet do |puppet|! puppet.pp_path = '/tmp/vagrant-puppet'! puppet.manifests_path = 'provisioning/manifests'! puppet.module_path = 'provisioning/modules'! puppet.manifest_file = manifest! end!end!!
!!Vagrant::Config.run do |config|! config.ssh.forward_x11 = true!! config.vm.define :pemaster do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.40"! box.vm.host_name = 'pemaster.boxnet'! end!! config.vm.define :peagent do |box|! flavor = :centos_64_pe! set_box box, LOCAL_BOXES[flavor]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.41"! box.vm.host_name = 'peagent.boxnet'! end!!! config.vm.define :puppetmaster do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! # NOTE: Headless or no?! #webnode_config.vm.boot_mode = :gui!! # NOTE: Hostonly _may_ mean no internets if this adapter gets found first!!!! # Check /etc/resolv.conf !! box.vm.network :hostonly, "192.168.23.20"! box.vm.host_name = 'puppetmaster.boxnet'!! # NOTE: Share folders, such as Git checkouts of the Puppet source code! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'server.pp'! end!! config.vm.define :puppetagent do |box|! flavor = :centos_6! set_box box, S3_BOXES[:centos_64_nocm]!! box.vm.network :hostonly, "192.168.23.21"! box.vm.host_name = "puppetagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :centos_59 do |box|! flavor = :centos_59_nocm! set_box box, S3_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.22"! box.vm.host_name = "centos-59.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[:centos_59]! provision_box box, 'agent.pp'! end!! config.vm.define :ubuntuagent do |box|! flavor = :ubuntu_1204! set_box box, S3_BOXES[:ubuntu_1204_nocm]!! box.vm.network :hostonly, "192.168.23.23"! box.vm.host_name = "ubuntuagent.boxnet"!! share_puppet_source box!! box.vm.provision :shell, :inline => BOOTSTRAPS[flavor]! provision_box box, 'agent.pp'! end!! config.vm.define :solaris_10 do |box|! box.vm.guest = :solaris! flavor = :solaris_10! set_box box, LOCAL_BOXES[flavor]!! box.vm.network :hostonly, "192.168.23.24"! box.vm.host_name = "solaris-10.boxnet"! end!! config.vm.define :debianagent do |box|! flavor = :debian_7_nocm! set_box box, S3_BOXES[flavor]!!
The uberVagrantfile
• Maintenance costs increase as more machines are added
• Unique to each individual or team
• Hard to scale across teams
Build Abstractions
Build Abstractions• Eliminate manual bookkeeping
Build Abstractions• Eliminate manual bookkeeping config.vm.define :pemaster do |node|!
node.vm.network :hostonly, "192.168.23.40"!end!!config.vm.define :peagent do |node|! node.vm.network :hostonly, "192.168.23.41"!end
Build Abstractions• Eliminate manual bookkeeping config.vm.define :pemaster do |node|!
node.vm.network :hostonly, "192.168.23.40"!end!!config.vm.define :peagent do |node|! node.vm.network :hostonly, "192.168.23.41"!end
config.vm.define :pemaster do |node|! node.vm.network :hostonly, auto_network: true!end!!config.vm.define :peagent do |node|! node.vm.network :hostonly, auto_network: true!end!
Build Abstractions• Eliminate manual bookkeeping
• Automate repetitive tasks
Build Abstractions• Eliminate manual bookkeeping
• Automate repetitive tasks
config.vm.define :pemaster do |node|! # ...!! node.vm.provision :pe_bootstrap do |p|! p.role = :master! p.version = '3.3.0'! end!end!
Build Abstractions• Eliminate manual bookkeeping
• Automate repetitive tasks
• Separate data from logic
Build Abstractions• Eliminate manual bookkeeping
• Automate repetitive tasks
• Separate data from logic
config.vm.define :pemaster do |node|! node.vm.hostname =! 'pe-330-master.puppetdebug.vlan'! node.vm.box = 'puppetlabs/centos-6.5-64-nocm'!! node.vm.network :hostonly, auto_network: true!! node.vm.provision :pe_bootstrap do |p|! p.role = :master! p.version = '3.3.0'! end!end!
Build Abstractions• Eliminate manual bookkeeping
• Automate repetitive tasks
• Separate data from logic
---!vms:! - name: pe-330-master! hostname: pe-330-master.puppetdebug.vlan! box: puppetlabs/centos-6.5-64-nocm! private_networks:! - auto_network: true! provisioners:! - type: pe_bootstrap! role: master! version: 3.3.0!
Build Abstractions• Eliminate manual bookkeeping
• Automate repetitive tasks
• Separate data from logic
---!vms:! - name: pe-330-master! hostname: pe-330-master.puppetdebug.vlan! box: puppetlabs/centos-6.5-64-nocm! roles:! - base! provisioners:! - type: pe_bootstrap! role: master! version: 3.3.0!!roles:! base:! private_networks:! - auto_network: true!
Build Abstractions• Eliminate manual bookkeeping
• Automate repetitive tasks
• Separate data from logic
---!vms:! - name: pe-330-master! debug-kit: true! box: puppetlabs/centos-6.5-64-nocm! roles:! - base!!roles:! base:! private_networks:! - auto_network: true!
Raw Materials
Raw Materials
• Which boxes are in use? Do the older boxes still work?
Raw Materials
• Which boxes are in use? Do the older boxes still work?
• How were the boxes created?
Raw Materials
• Which boxes are in use? Do the older boxes still work?
• How were the boxes created?
Phased Builds
Base Install
Phased Builds
Base Install
Shared Customizations
Phased Builds
Base Install
Shared Customizations
Puppet EnterpriseOpen Source
Phased Builds
Build Server
Base Install
Shared Customizations
Puppet EnterpriseOpen Source
Phased Builds
Where We Ended Up
Where We Ended Up
• Shared environments enable teams to focus on problem solving
Where We Ended Up
• Shared environments enable teams to focus on problem solving
• New employee on-boarding is easier
Where We Ended Up
• Shared environments enable teams to focus on problem solving
• New employee on-boarding is easier
• Company-wide efforts to build and maintain virtual environments are focused instead of scattered
• http://www.vagrantup.com/
• https://github.com/adrienthebo/oscar
• https://github.com/Sharpie/puppet-debugging-kit
• http://www.packer.io/
• https://vagrantcloud.com/puppetlabs
Resources