summaryrefslogtreecommitdiffstats
path: root/.travis.yml
diff options
context:
space:
mode:
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml30
1 files changed, 30 insertions, 0 deletions
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)