forked from bakhti/ansible-elk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
47 lines (37 loc) · 1.29 KB
/
.travis.yml
File metadata and controls
47 lines (37 loc) · 1.29 KB
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"
env:
- SITE=test.yml
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y curl python-pip python-apt gcc
install:
# Install Ansible.
- pip install ansible
# Add ansible.cfg to pick up roles path.
- printf '[defaults]\nroles_path = ../' > ansible.cfg
script:
# Check the role/playbook's syntax.
- ansible-playbook -i tests/inventory tests/$SITE --syntax-check
# Run the role/playbook with ansible-playbook.
- ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
# Run the role/playbook again, checking to make sure it's idempotent.
- >
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Make sure Java is installed.
- >
which java
&& (echo 'Java is installed: pass' && exit 0)
|| (echo 'Java is installed: fail' && exit 1)
# Logstash configtest
- /opt/logstash/bin/logstash agent -f /etc/logstash/conf.d/ --configtest
# Make sure Kibana is accessible
- >
curl -s http://localhost:80
| grep -q 'KIBANA_VERSION'
&& (echo 'Kibana is accessible: pass' && exit 0)
|| (echo 'Kibana is accessible: fail' && exit 1)