Automating development VM provisioning | News | PHPro
What's new in our world

Automating development VM provisioning

09 December 2015

Application development problems often boil down to platform configuration issues. When you're working in teams, this is even more the case. Differences in software versions and configuration between team members, and development environments (dev/uat/production) are often hard-to-tackle issues.

Automated virtualization tools like Vagrant are (a part of) the solution for a lot of teams, especially when coupled with an automated provisioning tool like Puppet or Ansible. At PHPro, we too elected for a setup like this, but with a twist.

Instead of managing different Vagrantfiles and configuration code bases per project (which often tend to have hard-coded parameters), we decided to separate data and code, and to make our Vagrant boxes configurable through user input.

When our developers run `vagrant up` for a new project, Vagrant will ask them for a few parameters concerning the project. These parameters, along with some pre-defined parameters in a separate configuration file, determine the VM to be spun up. When the VM is up and running, Vagrant will install and run Puppet to provision it.

One of those parameters, the box type, is passed on to Puppet. Puppet then uses it to determine which software should be deployed on the machine. Creating or altering a box type is as simple as writing a small YAML file in our Puppet data store, detailing the specific configuration needed.

This gives us a quick (new development environments can be deployed within 5 minutes) and very easy to use and flexible solution for our developers, which is also easily managed by our sysadmins.