You are previewing Pro Vagrant.
O'Reilly logo
Pro Vagrant

Book Description

Pro Vagrant teaches you how to effectively implement and optimize Vagrant in your everyday work environment. Master the creation and configuration of virtual development environments with an easy-to-use workflow, and focus on automation. Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past.

DevOps is mainstream best practice nowadays, and Vagrant sits firmly in the DevOps toolkit. This book will take you from basic usage and getting started, to provisioning with Shell, Puppet, and Chef. You will see how to use Vagrant in real-life scenarios, so that you can start to use Vagrant day-to-day in your work.

Author Wodimierz Gajda is a Vagrant expert and now brings his experience to you in Pro Vagrant. This is an indispensable book for anyone using Vagrant - add it to your library today.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Author
  8. About the Technical Reviewer
  9. Acknowledgments
  10. Chapter 1 : Getting Started with Vagrant
    1. What Is Vagrant?
    2. Client/Server Paradigm and its Aftermath
    3. Traditional Approach to Setting up a Developer Environment
    4. Virtualization to the Rescue
    5. Enter the Vagrant
    6. Vagrant Rulez!
    7. Disadvantages of Vagrant
    8. Vagrant for Trainers, Instructors, and Teachers
    9. Installing the Software
      1. Git
      2. VirtualBox
      3. Vagrant
    10. Basic Vagrant Configuration
    11. Documentation
    12. Summary
    13. In the Next Chapter, You’ll Learn . . .
    14. Reading List
    15. Test Yourself
  11. Chapter 2 : Four Web Frameworks in Four Minutes
    1. Project 1: “Songs for kids” Written in AngularJS
    2. Project 2: “Songs for kids” Written in Django
    3. Project 3: “Songs for kids” Written in Ruby on Rails
    4. Project 4: “Songs for kids” Written in Symfony
    5. What Have You Achieved?
    6. Shared Folders
    7. Stopping VMs
    8. Summary
    9. In the Next Chapter, You’ll Learn . . .
    10. Reading List
    11. Test Yourself
    12. Exercises
  12. Chapter 3 : The States of VM
    1. Before You Begin
    2. Getting the Source Code of the Example Application
    3. Vagrantfile
    4. Where Does the VM Image Come From?
    5. Booting the VM
      1. Stage I: Downloading and Installing the Box in the System
      2. Stage II: Importing the Base Box into the Project
      3. Stage III: Booting the System
    6. Files and Directories: Summary
      1. Files and Directories in Stage I
    7. Guest OS States
      1. running State
      2. poweroff State
      3. saved State
      4. not created State
      5. aborted State
    8. Vagrant Commands
      1. $ vagrant up Command
      2. $ vagrant halt Command
      3. $ vagrant suspend Command
      4. $ vagrant destroy Command
      5. $ vagrant reload Command
    9. How to Start and Stop a VM
    10. Running “Songs for kids” in Sinatra
      1. Killing and Preserving Processes in a Guest OS During Shutdown
      2. Preserving and Losing Files in a Guest OS During Shutdown
    11. Colliding Ports
    12. Removing the Box
    13. Summary
    14. In the Next Chapter You Will Learn . . .
    15. Reading List
    16. Test Yourself
    17. Exercises
  13. Chapter 4 : Default Configuration and Security Settings of the Guest VM
    1. Atlas
    2. Initializing a New Project
    3. Security Concern #1
    4. Booting the Guest OS
    5. Downloading the ubuntu/trusty32 Base Box from Atlas
    6. Default Configuration of a VM
      1. Forwarding Port 2222 on the Host to Port 22 on the Guest
    7. Security Concern #2
      1. Sharing a Project Directory
    8. Communication with the Outside World
    9. Analysis of “Songs for kids” in AngularJS
    10. Working with SSH
    11. Working with Multiple Guests
    12. Security Concern #3
    13. Using the authorized_keys File for SSH Authorization
    14. Security Concern #4
    15. Reloading the Guest OS
    16. Summary
    17. In the Next Chapter, You Will Learn . . .
    18. Reading List
    19. Test Yourself
    20. Exercises
  14. Chapter 5 : Your First Box
    1. The Task at Hand
    2. Choosing a Base Box and Initializing a New Project
    3. Installing the Necessary Software
    4. Generating a Box
    5. Listing, Installing, and Removing Boxes
    6. Using the Box
    7. Forwarding Ports
    8. Advantages of Boxing
    9. Serving Boxes over the Network
    10. Securing Your Boxes
    11. Repackaging Boxes
    12. Summary
    13. In the Next Chapter, You Will Learn . . .
    14. Reading List
    15. Test Yourself
    16. Exercises
  15. Chapter 6 : Provisioning
    1. Provisioners
    2. Configuring Provisioning
    3. Multiple Provisioners
    4. When Does Provisioning Happen?
    5. Versioning Boxes with git
    6. Jekyll Box with the Shell Provisioner
      1. Box Source Code
      2. First Run of the Shell Provisioner
      3. Versioning the Box Source Code
      4. Generating a Box
    7. Using the Shell-Provisioned Box
    8. Annoying “not a tty” Problem
    9. Jekyll Box with the Puppet Provisioner
      1. Box Source Code
      2. First Run of the Puppet Provisioner
      3. Versioning the Box Source Code
      4. Generating a Box
    10. Using a Puppet-Provisioned Box
    11. Jekyll Box with the Chef Provisioner
      1. Box Source Code
      2. First Run of the Chef Provisioner
      3. Versioning the Box Source Code
      4. Generating a Box
    12. Jekyll Box with the Ansible Provisioner
      1. Box Source Code
      2. First Run of the Ansible Provisioner
      3. Versioning the Box Source Code
      4. Generating a Box
    13. Workflow
    14. Summary
    15. In the Next Chapter, You Will Learn . . .
    16. Reading List
    17. Test Yourself
    18. Exercises
  16. Chapter 7 : Creating Boxes from Scratch
    1. Packer
    2. Installing Packer
    3. Building Boxes Using the chef/bento Project
    4. Using the Box Generated with chef/bento
    5. Building Boxes Using the boxcutter Project
    6. Using the Box Generated with the boxcutter Project
    7. How Does Packer Work?
    8. Customizing Boxes Generated with chef/bento
    9. VirtualBox Guest Additions
    10. Creating a Box Manually
      1. Downloading ISO Images
      2. Booting ISO Images
      3. Using the Boot Command and preseed.cfg
    11. Timing
    12. Working with the Open Virtualization Format (OVF )
    13. Summary
    14. In the Next Chapter, You Will Learn . . .
    15. Reading List
    16. Test Yourself
    17. Exercises
  17. Chapter 8 : Configuring Virtual Machines
    1. Vir?tualBox-Related Configuration
      1. VM Name
      2. GUI Mode
      3. RAM
      4. Number of CPUs
      5. Other Physical Properties
    2. General Settings
      1. Hostname
      2. Post-up Messages
      3. Booting and Halting Timeouts
      4. SSH
      5. X11 Forwarding
      6. Base Box
      7. Using Checksums for Boxes
    3. Networking
      1. Port Forwarding
      2. Port Collision
      3. Private Networks
      4. Public Networks
    4. Synced Folders
      1. Synchronization Types
      2. Benchmarking Disk Operations
      3. VirtualBox Shared Folders
      4. NFS
      5. rsync
      6. Server Message Block (SMB)
    5. Platform-Related Configuration
    6. Summary
    7. In the Next Chapter, You Will Learn . . .
    8. Reading List
    9. Test Yourself
    10. Exercises
  18. Chapter 9 : One True Workflow
    1. Most Common Antipattern
    2. Is it an Antipattern?
    3. Generating Base Boxes
      1. Generating Base Boxes with Packer
      2. Generating Customized Boxes
    4. Modularize Boxes with Provisioner Modules
    5. Embedding Submodules
    6. Puppet Submodule Antipattern
    7. Bake Everything in the Customized Box
    8. Summary
    9. In the Next Chapter, You Will Learn . . .
    10. Reading List
    11. Test Yourself
    12. Exercises
  19. Chapter 10 : Going Pro
    1. The Challenge
    2. SCM Tools
    3. Development/Production Mapping
    4. Multimachine Settings
    5. Debugging
    6. Using Vagrant Plug-ins
      1. Vagrant-cachier Plug-in
      2. Vagrant-winnfsd Plug-in
      3. Vagrant-puppet-install Plug-in
      4. Vagrant-omnibus Plug-in
      5. Vagrant-hostupdater Plug-in
      6. Vagrant-vbguest Plug-in
    7. Working with Atlas.Hashicorp.com
    8. Versioning Boxes
    9. Sharing Your Environment
      1. HTTP Shares
      2. SSH Shares
    10. Summary
    11. Reading List
    12. Test Yourself
    13. Exercises
  20. Index