Local Development

For the Local develop process we use a combination of Molecule and Vagrant it is recommendet to manage the dependencies in a own Virtualenv.

Configure a virtual env
 virtualenv -p python3 ~/venvs/develop-ansible_role-vagrant/
 source ~/venvs/develop-ansible_role-vagrant/bin/activate
 pip install requirementsDev.txt

Starting a local Vagrant Box

Molecule handle the Vagrant box and execute the Ansible playbooks.

Execute a full Tests Cycle
molecule test

for reexecuting the playbook use the converge command.

Starting a and configure a Vagrant Box
molecule converge

Package a new Vagrant Box

For creating new Vagrant box Versions we use Packer. Navigate to the Maintenance Build Directory (provisioning/maintenance/build) for packaging a new box.

build a reuseable box with packer
packer build minecraft_box.json

this will be need some minutes, but you got a reuseable and shareable Vagrant box, with a preconfigured ready to used Server.

Import the Box
 vagrant box add mc-gameserver-spigot file:///$(pwd)/output-vagrant/package.box --force

know when you have imported the new box Version, got to the Maintenance Directory (provisioning/maintenance) Directory and create the Virtual Machine.

Import the Box
 vagrant up
Ping the Box
export ANSIBLE_INVENTORY=$(pwd)/inventories/test/
ansible all -m ping