25 lines
682 B
YAML
25 lines
682 B
YAML
---
|
|
language: python
|
|
python: "2.7"
|
|
sudo: required
|
|
dist: trusty
|
|
|
|
before_install:
|
|
- sudo apt-get update -qq
|
|
- sudo apt-get install -qq python-apt python-pycurl
|
|
|
|
install:
|
|
- sudo pip install ansible
|
|
- echo -e 'localhost ansible_connection=local' > tests/inventory
|
|
- echo -e '[defaults]\nroles_path = ../\nhostfile = ./tests/inventory' > ansible.cfg
|
|
|
|
script:
|
|
- ansible-playbook --syntax-check tests/role.yml
|
|
- ansible-playbook -v --diff tests/role.yml
|
|
- ansible-playbook -v --diff tests/role.yml
|
|
- >
|
|
ansible-playbook tests/role.yml
|
|
| grep -q 'changed=0.*failed=0'
|
|
&& (echo 'Idempotence test: pass' && exit 0)
|
|
|| (echo 'Idempotence test: fail' && exit 1)
|