diff --git a/.travis.yml b/.travis.yml index 9b90639..a202ed9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,5 +8,10 @@ install: - pip install ansible==1.5.0 script: - echo localhost > inventory - - ansible-playbook --syntax-check -i inventory test.yml + - ansible-playbook -i inventory test.yml --syntax-check - ansible-playbook -i inventory test.yml --connection=local --sudo + - > + ansible-playbook -i inventory test.yml --connection=local --sudo + | grep -q 'changed=0.*failed=0' + && (echo 'Idempotence test: pass' && exit 0) + || (echo 'Idempotence test: fail' && exit 1) diff --git a/README.md b/README.md index 819de7c..10ba921 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,12 @@ utilities_extras: [] # List of additional utility package names to be ``` +#### Testing +This project comes with a VagrantFile, this is a fast and easy way to test changes to the role, fire it up with `vagrant up` + +See [vagrant docs](https://docs.vagrantup.com/v2/) for getting setup with vagrant + + #### License Licensed under the MIT License. See the LICENSE file for details. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..a5b98b1 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,16 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure('2') do |config| + config.vm.define 'anxs' do |c| + c.vm.box = 'ubuntu/trusty64' + c.vm.network :private_network, ip: '192.168.88.27' + c.vm.hostname = 'anxs.local' + c.vm.provision 'ansible' do |ansible| + ansible.playbook = 'test.yml' + ansible.sudo = true + ansible.inventory_path = 'vagrant-inventory' + ansible.host_key_checking = false + end + end +end diff --git a/vagrant-inventory b/vagrant-inventory new file mode 100644 index 0000000..1f68e33 --- /dev/null +++ b/vagrant-inventory @@ -0,0 +1,2 @@ +[anxs] +anxs.local ansible_ssh_host=192.168.88.27 ansible_ssh_port=22