summaryrefslogtreecommitdiffstats
path: root/.travis.yml
diff options
context:
space:
mode:
authorJeff Geerling <geerlingguy@mac.com>2014-05-09 09:44:06 -0500
committerJeff Geerling <geerlingguy@mac.com>2014-05-09 09:44:06 -0500
commit19dfa1942bb7452c4006055b69b5f0ac031f0ae7 (patch)
treee46ead317838444b02a561b8245d7f3a375fb10b /.travis.yml
parentfd9f99697d3f06f636d13a34206202eb26c5ca17 (diff)
downloadntp-19dfa1942bb7452c4006055b69b5f0ac031f0ae7.tar.gz
ntp-19dfa1942bb7452c4006055b69b5f0ac031f0ae7.tar.bz2
ntp-19dfa1942bb7452c4006055b69b5f0ac031f0ae7.tar.xz
ntp-19dfa1942bb7452c4006055b69b5f0ac031f0ae7.zip
Add Travis integration for real.
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)