-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (64 loc) · 2.99 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
language: python
python: "2.7"
before_install:
# Make sure everything's up to date.
- sudo apt-get update -qq
- sudo apt-get install -qq python-apt python-pycurl git python-pip
install:
# Install Ansible.
- pip install ansible
script:
- cd tests
# 1st: check syntax
- echo "***************************** SYNTAX CHECK test 1 (1) *****************************"
- ansible-playbook -i local.ini test1.yml --syntax-check
# 2nd: Make sure we run the entire playbook
- echo "***************************** RUN PLAY test 1 (2) *****************************"
- ansible-playbook -i local.ini test1.yml --sudo -vvvv
# 3rd: Make sure our playbook is idempotent
- echo "***************************** Idempotence test test 1 (3) *****************************"
- >
ansible-playbook -i local.ini test1.yml --sudo -vvvv | tee ansible_output
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# 1st: check syntax
- echo "***************************** SYNTAX CHECK test 2 (1) *****************************"
- ansible-playbook -i local.ini test2.yml --syntax-check
# 2nd: Make sure we run the entire playbook
- echo "***************************** RUN PLAY test 2 (2) *****************************"
- ansible-playbook -i local.ini test2.yml --sudo -vvvv
# 3rd: Make sure our playbook is idempotent
- echo "***************************** Idempotence test test 2 (3) *****************************"
- >
ansible-playbook -i local.ini test2.yml --sudo -vvvv | tee ansible_output
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# 1st: check syntax
- echo "***************************** SYNTAX CHECK test 3 (1) *****************************"
- ansible-playbook -i local.ini test3.yml --syntax-check
# 2nd: Make sure we run the entire playbook
- echo "***************************** RUN PLAY test 3 (2) *****************************"
- ansible-playbook -i local.ini test3.yml --sudo -vvvv
# 3rd: Make sure our playbook is idempotent
- echo "***************************** Idempotence test test 3 (3) *****************************"
- >
ansible-playbook -i local.ini test3.yml --sudo -vvvv | tee ansible_output
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
after_failure:
- echo "******IdepotanceLog *******"
- sudo cat ansible_output
- echo "******Syslog*******"
- sudo cat /var/log/syslog
- echo "******NerveLog*******"
- sudo cat /var/log/smartstack/nerve.log
- echo "******SerfLog*******"
- sudo cat /var/log/smartstack/serf.log
- echo "******SyanpaseLog*******"
- sudo cat /var/log/smartstack/synapse.log
- echo "******AnsibleFacts*******"
- ansible -i 127.0.0.1, -m setup all -c local