Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Advanced Vagrant Usage with Puppet

Advanced Vagrant Usage with Puppet

This talk was given at PuppetConf 2012. It covers how I use Vagrant with Puppet and how I automate a lot of what I do with Puppet.

Mitchell Hashimoto

September 27, 2012
Tweet

More Decks by Mitchell Hashimoto

Other Decks in Programming

Transcript

  1. - Manifest development, both simple and not so simple -

    Repeatability - Fast feedback Benefits We Want
  2. - Manifest development, both simple and not so simple -

    Repeatability - Fast feedback - Confidence Benefits We Want
  3. Automated Puppet Master - Pushing broken Puppet crashes the server.

    - Local development against a Puppet Master has benefits.
  4. Automated Puppet Master - Pushing broken Puppet crashes the server.

    - Local development against a Puppet Master has benefits. - Automation all the way down.
  5. “I suspect the answer is that they just don't test

    their modules adequately.” - Anonymous PuppetLabs Employee
  6. Multi-VM enables Vagrant to manage a cluster of machines that

    can communicate. http://vagrantup.com/v1/docs/multivm.html
  7. node 'test_exporter' { @@nginx::site { "test": content => "\n", tag

    => "origin", } } node 'test_collector' { include role::origin }
  8. Vagrant::Config.run do |config| config.vm.define :export do |n| n.vm.hostname = "test_exporter"

    n.vm.provision :puppet_server, :options => "--verbose --debug" end config.vm.define :collect do |n| n.vm.hostname = "test_collecter" n.vm.provision :puppet_server, :options => "--verbose --debug" end end
  9. node 'test_hiera' { $region = hiera("test_region") $role = hiera("test_role") $name

    = hiera("test_name") file { "/tmp/results": content => "$region $role $name", mode => "0644", } }
  10. Vagrant::Config.run do |config| config.vm.define :master do |master| master.vm.hostname = "puppet"

    master.vm.provision :shell, :path => "bootstrap.sh" end config.vm.define :node do |node| node.vm.hostname = "postgresql" node.vm.provision :puppet_server, :options => "--verbose --debug" end end
  11. - Git pull - Find env-* branches for environments. -

    RSync - Restart Puppet Master http://bit.ly/Qyg3RW Updater Script
  12. Note: I don’t use Puppet environments for dev because I

    like to keep production master just for production.