Vagrant and puppet: Deployment made easy

download Vagrant and puppet: Deployment made easy

If you can't read please download the document

description

Vagrant and puppet small intro

Transcript of Vagrant and puppet: Deployment made easy

  • 1. Vagrant + Puppet:deployment made easy.May 2014

2. WWhhoo??Geronimo OrozcoCloud Engineer & Free Software developer@patuxhttp://patux.nethttp://github.com/patux 3. Development Process 4. DDeevveellooppeerr ccoommmmoonn nniigghhttmmaarreess......Have you ever worked with... 5. DDeevveellooppeerr ccoommmmoonn nniigghhttmmaarreess......Multiple projects+Dependencies on various kinds of software in variousdegrees of stability=YYoouurr ddeevveellooppmmeenntt mmaacchhiinnee iiss bbeeccoommiinngg ffuullll ooff ccrraapp 6. DDeevveellooppeerr ccoommmmoonn nniigghhttmmaarreess......Multiple projects+Dependencies on the same software but with differentversions=YYoouurr ddeevveellooppmmeenntt mmaacchhiinnee iiss bbeeccoommiinngg ffuullll ooff ccrraapp((aaggaaiinn)) 7. DDeevveellooppeerr ccoommmmoonn nniigghhttmmaarreess......Existing developer with (partial and no up to date) info onhow to reproduce a development environment+New developer on the team (with a shiny new machine)=IIssssuueess ttoo rreepprroodduuccee tthhee ssaammee ddeevveellooppmmeenntteennvviirroonnmmeenntt 8. DDeevveellooppeerr ccoommmmoonn nniigghhttmmaarreess......Development environmentProduction/CI environment=WWoorrkkss oonn mmyy mmaacchhiinnee!!!!!! ssyynnddrroommee 9. AA ddeevveellooppmmeenntt ssttoorryy......IT EngineeringTaskRequiresComponent XRequiresComponent Y 10. AA ddeevveellooppmmeenntt ssttoorryy...... wwiitthh ssttoorryyppooiinnttss3 88 3IT EngineeringTaskRequiresComponent XRequiresComponent Y2 11. AA tteeaamm ooff 66 mmeemmbbeerrss......IT Engineering23 323 323 323 323 323 3 4488 12. $ git clone git://path/to/myapp.git$ cd myapp$ magic command$ ssh myenvironment. . . hack . . . 13. $ git clone git://path/to/myapp.git$ cd myapp$ vagrant up$ ssh myenvironment. . . hack . . . 14. VVaaggrraanntt Mitchel Hashimoto & John Bender http://vagrantup.com Based on Virtualbox, Ruby Runs on MacOS, Linux, Windows Supports multiple provisioners (puppet/chef/shell/powershell/Salt/Ansible/Docker)* Vagrant lowers development environment setup time, maximizes dev/prod parity,and makes the "works on my machine" excuse a relic of the past.Developers no longer need to worry about setting up complicated infrastructurecomponents. Projects with conflicting dependencies can each get their own sandbox-- keeping a developer's workstation free of the hacks needed for multiple versionsof software to coexist.*http://vagrantup.com 15. WWhhyy wwoouulldd uussee iitt?? Reduces setup time (3 steps & youre ready) Simplicity (you dont have to mess with vbox/vmware api) Self-Service (You dont have to ask for resources) Consistency (Your teammate gets the same exact environment) Repeatability (You can build/destroy/rebuild/shutdown as you please) Contained (You dont have to pollute your laptop and break things, get thedevelopment environment isolated but at the same time connected ) 16. CCaappaabbiilliittiieess Filesharing (A folder from your machine into the virtual machine) Port forwarding (A port from the vm pointing to a local port) Non-Intrusive (You can use your editor/ide from your machine writing into theshared folder) Multi VM Stack Not only one vm per config file You can build many environments as you want only limited by your workstation/laptopresources 17. VVaaggrraannttVVaaggrraannttffiillee Port fortwarding Synced folders VM configuration Network configuration SSH access Multiple providers Multiple provisioners Non intrusive 18. IT automation software 19. DDeemmoo ttiimmee!!$ git clone https://github.com/patux/rails-dev-box$ cd rails-dev-box$ vagrant up$ vagrant ssh 20. DDeemmoo ttiimmee!!$ cd /vagrant$ git clone https://github.com/railstutorial/sample_app.git$ rvm install ruby-1.8$ rvm use 1.8$ cd sample_app$ bundle install$ rake db:setup$ rails server 21. PPuuppppeett DSL to describeyour environmentconfiguration http://puppetlabs.com http://docs.puppetlabs.com 22. DDeevvOOppss && VVaaggrraanntt ccoommmmuunniittyy Chef & Puppet Friendly (Puppet standalone/server, Chef solo/server) We can create/reuse puppet modules or chef recipes Integrate to the cloud environment with minor tweaks Recipes across internet (Just google it: vagrant+project) http://vagrantbox.es You dont have to start from scratch Package (You can create a new basebox based on another according to your needs) Veewee (A tool to automate the creation of a basebox for your particular needs) Dont reinvent the wheelIT Engineering 23. PPrrooffiitt!! Decrease the time it takes for a developer to get up andrunning on a new project Isolate development environments from each other Increase your chance of successful deployment by mirroringthe production environment Reuse your Puppet or Chef recipes in production anddevelopment environments Keep your development machine small and fast 24. GGooiinngg ffuurrtthheerr Create your own base boxes http://vagrantup.com/docs/base_boxes.html Share your base boxes http://vagrantbox.es Multi-VM configuration http://vagrantup.com/docs/multivm.html Use it on your CI server Ex: http://travis-ci.org https://wiki.jenkins-ci.org/display/JENKINS/Vagrant+Plugin Extend with plugins http://vagrantup.com/docs/plugins.html 25. QQuueessttiioonnss ??Pizza time!!!Thank you Alesi Fuentes