From 5af6c01099d238dfce6db8303c3e2752d356d2f9 Mon Sep 17 00:00:00 2001 From: David Farrington Date: Sat, 21 Mar 2015 19:02:58 +0000 Subject: [PATCH 1/3] Added in vagrantfile --- Vagrantfile | 16 ++++++++++++++++ vagrant-inventory | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 Vagrantfile create mode 100644 vagrant-inventory diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..4ad24c9 --- /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.26' + 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..7fd4a9d --- /dev/null +++ b/vagrant-inventory @@ -0,0 +1,2 @@ +[anxs] +anxs.local ansible_ssh_host=192.168.88.26 ansible_ssh_port=22 From 88232eecb0cc2cf4b9a8f2a1734ee0fc0e525fe3 Mon Sep 17 00:00:00 2001 From: David Farrington Date: Sat, 21 Mar 2015 19:33:38 +0000 Subject: [PATCH 2/3] Add idempotence test and update readme --- .travis.yml | 7 ++++++- README.md | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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. From 2e3df3774dab736997bb0e71e797530b39b3a447 Mon Sep 17 00:00:00 2001 From: David Farrington Date: Sun, 22 Mar 2015 12:12:28 +0000 Subject: [PATCH 3/3] Bump IP to start sequencing at 1 --- Vagrantfile | 2 +- vagrant-inventory | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 4ad24c9..a5b98b1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,7 +4,7 @@ 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.26' + 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' diff --git a/vagrant-inventory b/vagrant-inventory index 7fd4a9d..1f68e33 100644 --- a/vagrant-inventory +++ b/vagrant-inventory @@ -1,2 +1,2 @@ [anxs] -anxs.local ansible_ssh_host=192.168.88.26 ansible_ssh_port=22 +anxs.local ansible_ssh_host=192.168.88.27 ansible_ssh_port=22