A small testing framework is provided with this role using Vagrant.
To test this role locally, once you've set up Vagrant, simply cd to tests and run vagrant up [ubuntu15|centos7], after which you can visit the following URLs in your browser for the associated deployments:
http://localhost:3000http://localhost:3001Note: To test SmartOS, please simply roll out a base64 zone
To log in, use admin as both the username & password.
As support for other operating systems/distributions is written, they will be added as options for testing.
It is expected that the following two handlers, triggered at the end of the test run will fail:
restart sensu-server servicerestart sensu-api serviceBoth these handlers use the delegate_to directive, which does not play nice with Vagrant.
This is expected to work in real deployments.
The inventory file generated by Vagrant may be prone to clashes when spinning up test VMs, as both the Ubuntu & CentOS Vagrant files have their VMs listed in the same groups.
This will usually be exhibited by failing tasks which require inventory fact lookups, so expect to see failures when doing index lookups against host groups.
A temporary workaround is to remove the inventory file generated by Vagrant: $ rm -f .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory