Vagrant-Goodhosts – Manage the hosts file with Vagrant in 2020

Vagrant is an awesome solution to deploy and manage virtual machines. Docker it’s a container ecosystem (honestly I don’t like them to be used by developers).

One of the plugin most used and with the best support (but not developed anymore) is vagrant-hostsupdater but on Windows has some troubles as example.

So for VVV we are using this plugin, but we are tired of all the issues that we get reported from the users, also because we don’t have Windows machines to do a lot of triage/testing.
Also, on working on documentation side and explaining to the users the installation process and how to handle the hosts file.

So the idea of Tom on this ticket was to create a new plugin from scratch that don’t implement a custom hosts file parser and specific operative system implementation.
The solution was to use GoodHosts with the cli tool that is written in Go, available for Windows/OSX/Linux and it is open source.

My idea was to fork the original vagrant plugin, so we don’t need to refactor the code and at the same time the migration for other any users in the future (also of our project) is very easy.

So I started to develop a new plugin, and we got a repository in the original organization of the project, testing a lot, feedback and a pr to the original VVV project to use it.

I don’t know Ruby but I think that is important to know a bit of every language, after releasing a python package, a javascript package, a perl project, php packages and worked with various other languages it was a funny experience.

This tool uses the same parameters of the original one and add a warning in the output if hostsupdater plugin is installed (one of the issue of this plugin is that is executed also when is not used).

The readme is based on the original project with some cleanings/simplification and the package include the package cli tool for the 3 systems.

Anyway I released official the last 1.0.1 version on Rubygems and the github repo it is available here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Vagrant-Goodhosts – Manage the hosts file with Vagrant in 2020

time to read: 1 min