How Vagrant Installation resource work with WSO2 products

As the word defined itself, installation experience is that you will get the experience of the installation on your software, This is just as important as the functionality of the software product as a whole. By giving the installation experience support of different enterprise platform will ensure that the software is capable of adapting to the enterprise environments. There are lots of installation options are available. Such as Docker, Puppet, Ansible, Vagrant, AWS,… etc. In this blog, I’m writing the installation experience on WSO2 product in Vagrant.
Vagrant is a tool for automating the creation and configuration of virtual machines. Vagrant provides a graphical user interface (GUI) to provision the virtual machine. Not just that, we can create virtual machines and add other required configuration by using a file called the Vagrantfile. By executing this Vagrantfile we can declare the kind of machine we want to have and what kind of tools we want that machine to make available and etc. These files use Ruby syntax. Writing a vagrantfile is the easiest way to work in vagrant. Once we are writing the vagrantfile its just a few commands that need to be executed.
To elaborate on the installation experience with Vagrant, I’m using WSO2 APIM product. In WSO2 website under the platform of API Management, you can see the vagrant installation options for APIM product. Instructions are there on how to play with Vagrnat with APIM. I’m discussing in-depth on the source code on how this is working.
As mentioned in the vagrant instruction of WSO2 APIM, you need to clone the vagrant-apim git hub repository. Once you download the repository you will see the folder structure of apim-with-analytics and apim-is-as-km-with-analytics. These are basically two patterns that we can use in APIM. APIM with APIM Analytics and APIM with Identity Server as key manager. Let’s dig on APIM with Analytics profile.
When you go into the apim-with-analytics folder you can see the set of folders, Vagrantfile and config.yaml file. In config.yaml file, we can define the Vagrant box names, IPs’, ports and the provisioner scripts that need to be executed inside the vagrant box. Provisioner script is just a shell script where you can define what needs to be executed inside the vagrant box. Such as Java setup, any configuration etc. We have to define each boxes configuration in config.yaml file.
There is command “vagrant up” in the vagrant instruction on WSO2 website to start the selected deployment. When you execute this command, it simply starts running the Vagratfile. As I mentioned above, I took the apim with analytics profile to describe the behaviour of apim with vagrant. So inside the apim-with-analytics folder, you can find the Vagrantfile. In this vagrant file we can define where we get the required vagrant boxes (either from the cloud or locally) and then it’s started to running the provisioner script which includes all the configurations and then starts to run the product packs. If you guys have your own customization you can add all to vagrantfile.
Aaaand we are done..!!! 😃
Hope you guys learn how we added the apim product installation experience with vagrant.
Cheers…!!! 🍻
