forked from astorije/ansible-thelounge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
32 lines (32 loc) · 1.08 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
language: python
env:
- ANSIBLE_VERSION="2.2.*"
# - ANSIBLE_VERSION="2.1.*"
# - ANSIBLE_VERSION="2.0.*"
# - ANSIBLE_VERSION="1.9.*"
# - ANSIBLE_VERSION="1.8.*"
# - ANSIBLE_VERSION="1.7.*"
# - ANSIBLE_VERSION="1.6.*"
# - ANSIBLE_VERSION="1.5.*"
# - ANSIBLE_VERSION="1.4.*"
# - ANSIBLE_VERSION="1.3.*"
# - ANSIBLE_VERSION="1.2.*"
before_install:
- sudo apt-get update -qq
install:
- pip install ansible==$ANSIBLE_VERSION
script:
# Check the role syntax
- ansible-playbook --inventory='localhost,' tests/test.yml --syntax-check
# Check that the role can run with no errors/failures
- ansible-playbook --inventory='localhost,' tests/test.yml --connection=local -vvvv
# Check idempotence of the role by running it twice and making sure there are
# no changed/failed tasks
- >
ansible-playbook --inventory='localhost,' tests/test.yml --connection=local
| tee /dev/stderr
| grep -q 'changed=0.*failed=0'
&& (printf '\n*** Idempotence test: ok ***\n' && exit 0)
|| (printf "\n*** Idempotence test: failed ***\n" && exit 1)
- ./tests/tests.sh
sudo: required