forked from DavidWittman/ansible-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
37 lines (34 loc) · 1.24 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
---
language: python
python: "2.7"
before_install:
- sudo apt-get update -qq
install:
- pip install ansible
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
script:
# Syntax check
- "ansible-playbook -i localhost, tests/test_server.yml --syntax-check"
- "ansible-playbook -i localhost, tests/test_sentinel.yml --syntax-check"
# Run role
- "ansible-playbook -i localhost, tests/test_server.yml --connection=local --sudo"
# Idempotency check
- >
ansible-playbook -i localhost, tests/test_server.yml --connection=local --sudo
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotency: PASS' && exit 0)
|| (echo 'Idempotency: FAIL' && exit 1)
- "ansible-playbook -i localhost, tests/test_sentinel.yml --connection=local --sudo"
- >
ansible-playbook -i localhost, tests/test_sentinel.yml --connection=local --sudo
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotency: PASS' && exit 0)
|| (echo 'Idempotency: FAIL' && exit 1)
- "/opt/redis/bin/redis-cli PING"
- "/opt/redis/bin/redis-cli -p 26379 PING"
# Facts syntax check
- >
sudo cat /etc/ansible/facts.d/redis.fact
| python -m json.tool
&& (echo 'Facts syntax: PASS' && exit 0)
|| (echo 'Facts syntax: FAIL' && exit 1)