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

Getting Started with Vagrant

Getting Started with Vagrant

Talk presented at DevFest Women in Istanbul #womentechmakers

Erika Heidi

March 02, 2014
Tweet

More Decks by Erika Heidi

Other Decks in Programming

Transcript

  1. whoami • Brazilian, living in Amsterdam since 2012 • PHP

    <independent> developer, eventually sysadmin • Author of Vagrant Cookbook on LeanPub
  2. What to expect from this talk • Introduction to Vagrant

    – Terminology, basic usage • Provisioning – Choosing a Provisioner – Practical Example with Ansible • ProTips • Useful Resources
  3. 1.1 Why Vagrant • Reproducible and portable development environment •

    Enables easier code collaboration • Backend env tests / benchmark • Automation Tools learning and testing
  4. 1.3 Terminology • Boxes • Host and Guest • Provider

    • Provisioner • Synced Folder • Vagrantfile
  5. 1.4 Getting Started Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url

    = "http://files.vagrantup.com/precise64.box" config.vm.provision "shell", inline: "echo hello, this is a simple Shell Provisioner!" end
  6. 2.1 Shell x Automation Tools • Automation Tools have powerful

    built-in features – Clear language – Idempotent State – Templating – Modularization
  7. 2.2 Automation Tools PUPPET CHEF ANSIBLE Syntax Custom based on

    Ruby Ruby YAML Terminology Manifests / Modules Recipes / CookBooks Playbooks / Roles Exec. Order Not sequential Sequential Sequential Documentation Confusing Chaotic Excellent Popularity 1st 2nd 3rd Extra Requirements - - ansible Overall Learning Curve Moderate High Low
  8. Playbook --- - hosts: all sudo: true tasks: - name:

    Update apt apt: update_cache=yes - name: Install Nginx apt: pkg=nginx state=latest - name: Install PHP5-fpm apt: pkg=php5-fpm state=latest
  9. 3.2 Debugging • Unknown Vagrant error – Use VirtualBox /

    Vmware GUI • Unknown Provisioner error – Increase provisioner verbosity • Not working as expected – Login, fix, automate