-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (35 loc) · 1.2 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
language: python
python: "2.7"
dist: bionic
addons:
apt:
packages:
- python-pip
- python-apt
services:
- docker
install:
# Install ansible
- pip install ansible
# don't use travis virtualenv, as ansible does not do so either
# and couldn't find the docker package that way
- sudo -H pip install docker-py
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
# Install requirements
- ansible-galaxy install -r tests/requirements.yml -p ../
- ansible-playbook tests/prepare.yml -i tests/inventory --connection=local --become
script:
# Syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
# Run playbook
- ansible-playbook tests/test.yml -v -i tests/inventory --connection=local --become
# Run playbook again to check idempotency
- ansible-playbook tests/test.yml --diff -i tests/inventory --connection=local --become | tee idempotence-test.log
- >
grep -q 'asterisk-docker.*changed=0.*failed=0' idempotence-test.log
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/