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.
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.
molecule test
for reexecuting the playbook use the converge
command.
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.
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.
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.
vagrant up
export ANSIBLE_INVENTORY=$(pwd)/inventories/test/
ansible all -m ping