forked from franlr/ocs
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
33 lines (29 loc) · 1.18 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
---
#virt: lxd
os: linux
arch: amd64
dist: focal
language: minimal
branches:
only:
- master
before_install:
- sudo rm -f /etc/apt/sources.list.d/pgdg.list # https://travis-ci.community/t/sometimes-build-fails-when-apt-is-updating-postgresql-apt-repository/4872
- sudo apt-get update -qq
- sudo apt-get install -y python3-pip
install:
- sudo -H python3 -m pip install --upgrade pip setuptools wheel
- sudo -H python3 -m pip install --upgrade ansible
# Add ansible.cfg to pick up roles path.
- "printf '[defaults]\ngathering = smart\nroles_path = roles/' > ansible.cfg"
script:
# Check the role/playbook's syntax.
- "ansible-playbook -vv -i tests/inventory tests/test.yml --syntax-check"
# Run the role/playbook with ansible-playbook.
- "travis_wait ansible-playbook -i tests/inventory tests/test.yml --connection=local --extra-vars @tests/hosts-vars.yml"
# Run the role/playbook again, checking to make sure it's idempotent.
- >
ansible-playbook -i tests/inventory tests/test.yml --connection=local --extra-vars @tests/hosts-vars.yml
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)