Vagrant environment with an Ubuntu 20.04 LTS VM for testing Ansible roles using Molecule and Docker.
This setup is based on my Ansible skeleton.
- Fork and/or clone this repository
- Enter the directory containing your local copy
- Edit
vagrant_hosts.yml
and change thesrc:
field of the synced folder to the directory on the physical system where Ansible roles are kept. - Start the environment with
vagrant up
- Git (including Git Bash on Windows)
- VirtualBox (including the Extension Pack!)
- Vagrant
Log in on the VM with vagrant ssh
and enter the role directory with cd ansible/ROLE_NAME
. From there, you can execute molecule test
(provided Molecule testing was initialized for that role).
The VM has some tools for monitoring the system and manage containers.
- Cockpit (web based system monitoring dashboard): https://192.168.56.20:9090
- Log in with user
vagrant
and passwordvagrant
- Log in with user
- Portainer.io (webinterface for Docker management): https://192.168.56.20:9000
- The first time you access the Portainer webinterface, you need to create an admin user account.
- Portainer is installed as a Docker container. It should start automatically after system boot & any configuration you change should be persistent.