Vagrant

From Freephile Wiki
Jump to: navigation, search

Vagrant is computer software for creating and configuring virtual development environments. It can be seen as a wrapper around virtualization software such as VirtualBox, KVM, VMware and around configuration management software such as Ansible, Chef, Salt or Puppet.

Vagrant uses provisioners like Ansible to do the 'work' and providers like VirtualBox to provide the host/platform. Cloud providers can be AWS, or OpenStack; Containerization can be done with Docker or LXC.

I prefer Ansible over Chef or Puppet, yet the latter are the biggest 'provisioners' for Vagrant. And, I prefer Digital Ocean to AWS and the former is only available as a provider for Vagrant through a 3rd-party plugin[1]. Thus, we use Vagrant to build local development environments provided by VirtualBox, and provisioned by Ansible. We use the same Ansible playbooks to provision hosts at DigitalOcean

Vagrant was created by HashiCorp which is a leader in DevOps with a Tao which underlies their product portfolio and technology.

While it was in beta, it was great to be able to create a vagrant box, and then vagrant share that box publicly even when the machine was located internally (MG project with MediaWiki vagrant). Haven't used it since, so need to reevaluate how vagrant-share works now for future projects. No doubt vagrant will continue to be extremely useful.

Code[edit | edit source]

https://github.com/hashicorp/vagrant Vagrant is distributed under the MIT license.

Plugins[edit | edit source]

  • https://github.com/devopsgroup-io/vagrant-digitalocean A Vagrant provider plugin that manages DigitalOcean droplets.
  • Vagrant Hostmanager from the DevOps Group in Philadelphia, PA let's you manage the 'hosts' file on your guests, and optionally the host system itself, to make multi-node deployments easier. Note that there are a handful of 'vagrant hostmanager' plugins [2] The DevOps Group also makes Catapult which is a system compared to Pantheon or Acquia for managing the full lifecycle of Drupal hosting.
  • [1] A Dnsmasq Vagrant plugin that manages the dnsmasq.conf file and /etc/resolver directory on your host system.


Creating a CentOS 7 box[edit | edit source]

You need a CentOS box to develop/test?

  1. make a new folder: mkdir ~/src/centos7 && cd ~/src/centos7
  2. vagrant init centos/7 will write your Vagrantfile for you
  3. vagrant up will start (and build) the virtual machine
  4. vagrant box update will pull in all the updates to the base box

See https://app.vagrantup.com/centos/boxes/7


See Also[edit | edit source]

MediaWiki-Vagrant


References[edit source]