In one of my previous posts I presented a solution to automate a Tomcat cluster installation using Ansible. One of the assumptions I made at the time was that the actual machines (physical or virtual) were already running and that Ansible could access them via SSH. Well, that might be true for a real production-like environment but what if you wanted to test this out on your local machine? Wouldn’t it be cool to spin up some virtual machines first and then use Ansible to provision them with the click of a button? Vagrant to the rescue!
Vagrant’s motto is “Development environments made easy” and in this post I plan to prove that and show how we can improve our existing sample project. I am not going to spend time going through the installation steps since I believe the official Vagrant installation guide is pretty clear already.
The code for the sample project can be downloaded from here.