-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
44 lines (31 loc) · 981 Bytes
/
.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
33
34
35
36
37
38
39
40
41
42
43
44
---
dist: 'trusty'
env:
global:
- ANSIBLE_FORCE_COLOR: True
- ANSIBLE_LOG_PATH: './ansible.log'
- ANSIBLE_ROLES_PATH: '../'
language: 'python'
python:
- '2.7'
sudo: 'required'
install:
# Install test requirements
- 'pip install -r requirements-devel.txt'
- |
if [ -f tests/requirements.yml ]; then
ansible-galaxy install -r tests/requirements.yml
fi
script:
# Check syntax of YAML files.
- 'yamllint -c .yamllint.conf .'
# Check syntax of role.
- 'ansible-playbook -i localhost, -c local tests/test.yml --syntax-check'
# Run role.
- 'ansible-playbook -i localhost, -c local tests/test.yml --diff --verbose'
# Run role again to check idempotence failure.
- 'ansible-playbook -i localhost, -c local tests/test.yml --diff --verbose'
# Detect idempotence failure.
- 'tail -n 1 ansible.log | grep -Eq "changed=0 +unreachable=0 +failed=0"'
notifications:
webhooks: 'https://galaxy.ansible.com/api/v1/notifications/'