/elasticluster-roles-testing

quick test to use molecule with elasticluster ansible roles

Primary LanguagePython

Testing molecule with ElastiCluster roles

  • Install elasticluster with this script

  • Install all the python deps doing pip install -r requirements.txt

  • Install Vagrant and VirtualBox

Now you are ready to do the first test:

$> cd ntpd/
$> molecule test

This should boot two vagrant VMs (centos7 and ubuntu16.04) and test the role:

  • Check syntax with yamlint
  • Check idempotence
  • Check ansible best practices with ansible-lint
  • Run unit tests with TestInfra
    • You can see the unit tests here
  • Run the tests in Centos and Ubuntu
    • See the config here

Future testing?

Try the molecule openstack driver?

Create a cookiecutter template to automate the creation of molecule configs for elasticluster?

Configure CI to run the tests automatically?

drawbacks / issues

I could not use the group_vars/all provided by elasticluster. This is because ElastiCluster recommends 1role >> 1repo but it can also be adapted to Monolith Repo