Instant LAMP Stack with Vagrant and Puppet Patrick Lee Boise Code Camp March 16, 2013 Developer Preview @ BWT Meetup
Agenda ● What is the problem anyway? ● What is Vagrant? ● Examples! ● What is Puppet? ● More examples! ● Simulating production architecture? ● Even more examples! ● Integration with Amazon EC2 ● One more example! ● Related topics ● Questions? ● References
What is the problem anyway? Setting up a development environment is not a fun way to spend an afternoon. Options: ● Using a remote server ● Installing everything locally ● Creating a virtual machine Let's take a look at each of these...
Using a remote server Pros: ● It's separate from your machine ● No divergence of environments ● You can rebuild your own machine at will Cons: ● You have to push code to it ● You probably have to share it with others ● It's just inefficient at best ● What if you're out of the office?
Installing everything locally Pros: ● You have complete control over it ● Nobody else is breaking using it Cons: ● It's time-consuming ● It's not easily repeatable ● Barrier to rebuilding your machine ● No standards among teammates
Creating a virtual machine Pros: ● It keeps your own machine cleaner ● VM's can be snapshotted ● VM's are portable (sort of) Cons: ● Initial installation is time-consuming ● Virtual machine images are big ● There's still configuration when copying them
Enter Vagrant! Pros: ● Can be run entirely on your machine ● Defines all configuration externally ● Consistent, repeatable, and reliable ● Can standardize environments for your team ● Keeps your own machine cleaner ● You can rebuild your own machine at will Cons: ● Expectation of increased productivity?
What is Vagrant? Vagrant is a tool that allows developers to... "Create and configure lightweight, reproducible, and portable development environments." ● Available for Linux, Mac, and Windows ● Also available as a Ruby Gem ● Uses Oracle's VirtualBox ● Uses Puppet or Chef for provisioning
Examples!
What is Puppet? "Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance." ● Define all your configuration in text files ● Apply the configuration to machines ● Modify the configuration at will ● Ensure that all machines are up-to-date ● Simple yet powerful technology
More examples!
Simulating production architecture? A single VM is all well and good, but we need to simulate production. No problem! ● Create as many types of VM's as you like ● Spin up one of each or entire clusters ● The only limit is your hardware
Even more examples!
Integration with Amazon EC2 Yes. Several possible workflows. Here's mine... 1. Define all configuration in Puppet 2. Test the configuration with Vagrant 3. Create EC2 instances 4. Run a setup script on each instance 5. Run headless Puppet on each instance Tools are evolving rapidly, so this approach is probably already kludgy... but it works.
One more example!
Related topics PuppetForge is a repository of Puppet modules provided by the community. rspec-puppet is a tool for testing Puppet modules. Chef is another option for provisioning with Vagrant. AWS OpsWorks is a new service for configuration management, provisioning, application deployments, auto-scaling, routing, load balancing, and more.
Questions?
Resources Code: https://github.com/patrickdlee/vagrant-examples Slides: TBD (on SlideShare) Me: @patrickdlee on Twitter Links: ● http://www.vagrantup.com/ ● https://puppetlabs.com/ ● http://forge.puppetlabs.com/ ● http://rspec-puppet.com/ ● http://www.opscode.com/chef/ ● https://aws.amazon.com/opsworks/
Feedback? Looking for feedback on... ● time spent on slides vs code ● explaining problem and options ● introducing Vagrant ● introducing Puppet ● spreading examples through the talk ● number of examples ● complexity of examples ● difficulty level of material ● anything else...
Recommend
More recommend