processone / ejabberd-vagrant-dev

Vagrant and Ansible script to create a VM preconfigured for ejabberd development
31 stars 13 forks source link

ejabberd Development Environment

This project will help you create a VM preconfigured with a environment ready to jump start ejabberd development.

It will have configured all the database back-end supported by ejabberd, so that you can run tests against all back-ends while developing.

Installation

Running the VM

Commands:

or if you want VirtualBox:

ulimit -n 4096 # see https://github.com/mitchellh/vagrant/issues/2435
vagrant up --provider=virtualbox

Note: if you have only VirtualBox or VMWare, no need to pass the provider arguments, it will be detected automatically (I think).

You can simply ask vagrant to run Ansible to install and configure the needed software:

vagrant provision

Alternatively, you can manually run Ansible play

ansible-playbook --connection ssh -u vagrant -i ansible/ansible.vmhosts ansible/playbooks/ejabberd_dev/bootstrap.yml

Note: I force the use of SSH instead of paramiko, as SSH option seems more reliable.

Building ejabberd to run ejabberd tests

Typically, you can check out the ejabberd code in the projects directory. It will be accessible in the VM (at least for VMware) from the shared folder /projects:

git clone git@github.com:processone/ejabberd.git projects/ejabberd

From the VM, you can then build ejabberd, with all dependencies enabled for development:

./autogen.sh && ./configure --enable-mysql --enable-pgsql --enable-riak --enable-sqlite --enable-elixir --enable-tools 
make
make test

Known issues

For VirtualBox, I struggled a bit with this one:

Useful learning resources

Ansible is the tool used to create the recipes for automatic deployment. Here are useful resources:

Clean-up of previous Vagrant version

Before having an executable installer, Vagrant was published as a ruby gem.

I had to do a bit of clean-up to make things working, here is what I had to do.

Also useful: http://docs.vagrantup.com/v2/installation/uninstallation.html

Notes on box downloads

For me downloading a Vagrant box was a bit slow (40KBytes/sec).

To save time I tried using Axel (brew install axel) and got a 5x+ improvement (270KBytes/sec).

I used the following steps for the VirtualBox box download:

I verified the box url here.