Chapter 1. Vagrant Development Environments

In this chapter, we will cover the following recipes:

  • Adding an Ubuntu Xenial (16.04 LTS) Vagrant box
  • Using a disposable Ubuntu Xenial (16.04) in seconds
  • Enabling VirtualBox Guest Additions in Vagrant
  • Using a disposable CentOS 7.x with VMware in seconds
  • Extending the VMware VM capabilities
  • Enabling multiprovider Vagrant environments
  • Customizing a Vagrant VM
  • Using Docker with Vagrant
  • Using Docker in Vagrant for a Ghost blog behind NGINX
  • Using Vagrant remotely with AWS EC2 and Docker
  • Simulating dynamic multiple host networking
  • Simulating a networked three-tier architecture app with Vagrant
  • Showing your work on the LAN while working with Laravel
  • Sharing access to your Vagrant environment with the world
  • Simulating Chef upgrades using Vagrant
  • Using Ansible with Vagrant to create a Docker host
  • Using Docker containers on CoreOS with Vagrant

Introduction

Vagrant is a free and open source tool by Hashicorp aimed at building a repeatable development environment inside a virtual machine, using simple Ruby code. You can then distribute this simple file with other people, team members, and external contributors, so that they immediately have a working running environment as long as they have virtualization on their laptop. It also means that you can use a Mac laptop, and with a simple command, launch a fully configured Linux environment for you to use locally. Everyone can work using the same environment, regardless of their own local machine. Vagrant is also very useful to simulate full production environments, with multiple machines and specific operating system versions. Vagrant is compatible with most hypervisors, such as VMware, VirtualBox, or Parallels, and can be largely extended using plugins.

Vagrant uses boxes to run. These boxes are just packaged virtual machines images that are available, for example, from https://atlas.hashicorp.com/boxes/search, or you can alternatively build your own using various tools.

Vagrant can be greatly extended using plugins. There're plugins for almost anything you can think about, and most of them are community supported. From specific guest operating systems to remote IaaS providers, features around sharing, caching or snapshotting, networking, testing or specifics to Chef/Puppet, a lot can be done through plugins in Vagrant.

A list of all available plugins, including all Vagrant providers is available on the Vagrant wiki here: https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Plugins.

More information about all integrated providers can be found on Vagrant's website: https://www.vagrantup.com/docs/providers/.

You can download a Vagrant installer for your platform from https://www.vagrantup.com/downloads.html.

Note

The Vagrant version in use for this book is Vagrant 1.8.4

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.193.232