Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Vagrant and CentOS 7

14,768 views

Published on

An introduction to Vagrant, using CentOS 7, given at CentOS Dojo Paris 2014 (2014/08/25).

Published in: Technology

Vagrant and CentOS 7

  1. 1. . VVaaggrraanntt aanndd CCeennttOOSS 77 Julien Pivotto CentOS Dojo, Paris August 25, 2014
  2. 2. . wwhhooaammii JJuulliieenn PPiivvoottttoo • System administrator at inuits.eu • CentOS user since CentOS 5.5 • DevOps believer • Open-source defender since 2004 • roidelapluie on twitter/github
  3. 3. . • Tool to build development environments • Easy to use, easy to configure • Extensible via plugins • Supports config management utilities ▶ Chef ▶ Puppet ▶ Cfengine ▶ Docker ▶ …
  4. 4. . AA bbiitt ooff ccoonntteexxtt • Born in 2010 as a ruby gem • Written by Mitchell Hashimoto (@mitchellh) • Used to be a wrapper around VirtualBox
  5. 5. . WWoorrkkiinngg wwiitthhoouutt VVaaggrraanntt
  6. 6. . WWoorrkkiinngg wwiitthhoouutt VVaaggrraanntt • Hard to rebuild, reproduce • No isolation • Not the same OS as in production • What if multiple versions of mysqld/java/…?
  7. 7. . WWoorrkkiinngg wwiitthh VVaaggrraanntt
  8. 8. . FFiixxeedd pprroobblleemmss • Easy to rebuild, reproduce • No more "Works on my machine" • Use the same OS as the production OS • Use multiple VM's if needed • Desktop OS is not full of useless config
  9. 9. . DDeevveellooppmmeenntt eennvviirroonnmmeenntt • One or multiple virtual machine, container, … • Provisionned (puppet, chef, ansible, script…) • Any operating system • A lot of providers supported ▶ Virtualbox ▶ Docker ▶ AWS (plugin) ▶ KVM/Qemu (plugin) ▶ LXC (plugin) ▶ Also closed source VMWare, Hyper-V
  10. 10. . AA VVaaggrraanntt bbaassee bbooxx • A VM or an image or a Dockerfile • SSH access if virtual machine • SSH user for Vagrant • Optional provisioning systems
  11. 11. . vvaaggrraanntt bbooxx lliiffeeccyyccllee
  12. 12. . vvaaggrraanntt bbooxx lliiffeeccyyccllee
  13. 13. . vvaaggrraanntt bbooxx lliiffeeccyyccllee
  14. 14. . GGeettttiinngg ssttaarrtteedd • Install Virtualbox and Vagrant • Import your first box ▶ centos.org ▶ vagrantcloud.com ▶ vagrantbox.es
  15. 15. . IImmppoorrttiinngg aa VVaaggrraanntt bbaassee bbooxx
  16. 16. . IImmppoorrttiinngg aa VVaaggrraanntt bbaassee bbooxx
  17. 17. . vvaaggrraanntt bbooxx aadddd <<bbooxx uurrll>> • Fetches a base box • Takes an URL, a json file or a tarball as parameter • Adds it to the available base boxes • Now we can use the box at will!
  18. 18. . CCrreeaattiinngg aa VVaaggrraannttffiillee
  19. 19. . CCrreeaattiinngg aa VVaaggrraannttffiillee
  20. 20. . vvaaggrraanntt iinniitt <<bbooxx nnaammee>> CCrreeaatteess aa ssiimmppllee VVaaggrraannttffiillee • The Vagrantfile is the configuration file • It contains the definition of the environment • It is written in ruby
  21. 21. . SSiimmppllee VVaaggrraannttffiillee VAGRANTFILE_API_VERSION = "2" Vagrant.configure( VAGRANTFILE_API_VERSION ) do |config| config.vm.box = "vStone/centos

×