Issue #2: Add Travis CI test integration.

This commit is contained in:
Jeff Geerling 2014-11-12 14:21:21 -06:00
parent b71bb51c8d
commit ac20f41190
4 changed files with 39 additions and 1 deletions

30
.travis.yml Normal file
View file

@ -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
# Add ansible.cfg to pick up roles path.
- "{ echo '[defaults]'; echo 'roles_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)

View file

@ -1,6 +1,8 @@
# Ansible Role: NFS
Installs NFS utilities on RHEL/CentOS.
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-nfs.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-nfs)
Installs NFS utilities on RedHat/CentOS or Debian/Ubuntu.
## Requirements

1
tests/inventory Normal file
View file

@ -0,0 +1 @@
localhost

5
tests/test.yml Normal file
View file

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-nfs