-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
51 lines (40 loc) · 2.71 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
---
language: python
python:
- 2.7
services:
- docker
sudo: required
env:
matrix:
- os=centos version=6 container_id=$(mktemp) ANSIBLE_VERSION=latest
- os=centos version=6 container_id=$(mktemp) ANSIBLE_VERSION=2.4.3
- os=centos version=6 container_id=$(mktemp) ANSIBLE_VERSION=2.3.3
- os=centos version=6 container_id=$(mktemp) ANSIBLE_VERSION=2.2.3
- os=centos version=7 container_id=$(mktemp) ANSIBLE_VERSION=latest
- os=centos version=7 container_id=$(mktemp) ANSIBLE_VERSION=2.4.3
- os=centos version=7 container_id=$(mktemp) ANSIBLE_VERSION=2.3.3
- os=centos version=7 container_id=$(mktemp) ANSIBLE_VERSION=2.2.3
install:
- if [ "${ANSIBLE_VERSION}" = "latest" ]; then sudo pip install ansible; else sudo pip install ansible==${ANSIBLE_VERSION}; fi
- docker pull ${os}:${version}
- sudo docker build --file tests/Docker/Dockerfile.${os}${version} --tag=${os}${version} tests/Docker
script:
- docker run --privileged -d --name target.host ${os}${version} /sbin/init > "${container_id}"
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
- ansible-playbook tests/test.yml -i tests/inventory
- ansible-playbook tests/test.yml -i tests/inventory | grep -q 'changed=0.*failed=0' && (echo "" && exit 0) || (echo 'Changed or failed after retry' && exit 1)
- sudo docker exec -t "$(cat ${container_id})" ps ax | grep [c]hronyd && if [ $? -ne 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/chrony.conf | grep "server time1.google.com iburst"; if [ $? -ne 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/chrony.conf | grep "server time2.google.com iburst"; if [ $? -ne 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/chrony.conf | grep "server time3.google.com iburst"; if [ $? -eq 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/chrony.conf | grep "bindcmdaddress 127.0.0.1"; if [ $? -eq 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/chrony.conf | grep "/var/log/chrony"; if [ $? -ne 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/logrotate.d/chrony | grep "missingok"; if [ $? -ne 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/logrotate.d/chrony | grep "/usr/libexec/chrony-helper"; if [ $? -ne 0 ]; then exit 1; fi
- sudo docker exec -t "$(cat ${container_id})" cat /etc/logrotate.d/chrony | grep "rotate 7"; if [ $? -ne 0 ]; then exit 1; fi
after_script:
- sudo docker stop "$(cat ${container_id})"
- sudo docker rm "$(cat ${container_id})"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/