forked from overdrive3000/ansible-percona
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
36 lines (32 loc) · 1.29 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
---
language: python
python: "2.7"
before_install:
- sudo apt-get update -qq
# Remove MySQL
- sudo apt-get -f install -o Dpkg::Options::="--force-overwrite"
- sudo apt-get remove --purge -s mysql\*
- sudo apt-get autoremove
- sudo apt-get autoclean
- sudo rm -rf /var/lib/mysql
- sudo truncate -s 0 /var/log/mysql/error.log
install:
- pip install ansible
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
script:
# Check role systax
- "ansible-playbook -i tests/inventory tests/test.yml --syntax-check"
# Run role with ansible-playbook
- "ansible-playbook -i tests/inventory tests/test.yml --connection=local"
# Test role idempotence
- >
ansible-playbook -i tests/inventory tests/test.yml --connection=local
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Test MySQL connection
- >
mysql -u root -preallylongpassword -e 'show databases;'
| grep -q 'performance_schema'
&& (echo 'MySQL running normally' && exit 0)
|| (echo 'MySQL not running' && exit 1)