From 19dfa1942bb7452c4006055b69b5f0ac031f0ae7 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 9 May 2014 09:44:06 -0500 Subject: Add Travis integration for real. --- .travis.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .travis.yml (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3eee176 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +--- +language: python +python: "2.7" + +env: + - SITE=test.yml + +before_install: + - sudo apt-get update -qq + +install: + # Install Ansible. + - pip install ansible==1.5.0 + + # Add ansible.cfg to pick up roles path. + - "printf '[defaults]\nroles_path = ../' > ansible.cfg" + +script: + # Check the role/playbook's syntax. + - "ansible-playbook -i tests/inventory tests/$SITE --syntax-check" + + # Run the role/playbook with ansible-playbook. + - "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo" + + # Run the role/playbook again, checking to make sure it's idempotent. + - > + ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo + | grep -q 'changed=0.*failed=0' + && (echo 'Idempotence test: pass' && exit 0) + || (echo 'Idempotence test: fail' && exit 1) -- cgit v1.2.3