Dev Machine Setup for Vagrant!

On Macs, all the software is pretty automatic. Munki installs VirtualBox, git, and Vagrant. On Ubuntu, you’ve got a few more steps - add our apt-repo and install VirtualBox, Vagrant, git, nfs-kernel-server. From there, the user simply has to install our vagrant plugin and run it. That will clone all the repos, install other plugins, and configure anything that needs to be configured!

And that’s it! vagrant up.

Well, sort of anyway. We have a vagrant plugin that helps manage our vagrant resources. This plugin is internal only at the moment because it statically deals with our project configuration. Essentially it has 3 commands - setup, clean, and purge. The setup command checks your vagrant install for the plugins that we require, and installs them if you don’t have them or if you are out of date. It also clones all the git projects you need and prompts you to configure your a role-based environment variable to determine certain aspects of your vagrant instance.

purge and clean are troubleshooting/cleanup functions. clean removes references to a VirtualBox machine in Virtualbox, as well as the actual files. It also deletes the .vagrant stuff in your project folder and a few other basic things. purge goes ahead and deletes ~/.vagrant.d, where all your boxes and plugins are stored, in addition to the stuff clean was doing.

So a new Dev turns on their machine, gets our plugin, runs that, and then they can go to our vagrant project and run vagrant up!

I recommend that anyone looking to support developers using vagrant should make a plugin like ours - it drastically reduces the time spent cloning git repos, installing other vagrant plugins, troubleshooting weird vagrant leftovers, etc! Our plugin is currently hardcoded to our setup, but at some point I would like to revamp it so it can take an external config file - that way it would be useful to everyone.

 
0
Kudos
 
0
Kudos

Now read this

Using Open Directory with Gitlab

So along the same lines as my previous post, I was tasked with migrating authentication for our GitLab service from OpenLDAP to Open Directory, and again… not much to be found online! Most of what I found was very hacky and involved... Continue →