Vagrant provides an easy way to test Ansible roles in an encapsulated environment. It is an abstraction layer for multiple virtualisation platforms. A possible setup is defined in the Vagrantfile inside this repository.
There are some dependencies to test Ansible roles with vagrant:
To run the test environment use
Furthermore you can check your Ansible stuff with multiple linters (e.g.
ansible-lint or yamllint) and you can verify your playbooks and roles with
ansible-playbook --syntax-check. You’ll find an example how to do that
inside the GitLab CI in the