forked from kyl191/ansible-role-openvpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (51 loc) · 1.61 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
---
language: python
sudo: required
services:
- docker
env:
global:
COMMAND=/usr/lib/systemd/systemd --system
matrix:
- DOCKER_TAG=centos:7
OS_TAG=centos-7
OS=centos
- DOCKER_TAG=fedora:latest
OS_TAG=fedora-latest
OS=fedora
- DOCKER_TAG=fedora:28
OS_TAG=fedora-28
OS=fedora
- DOCKER_TAG=fedora:27
OS_TAG=fedora-27
OS=fedora
- DOCKER_TAG=fedora:26
OS_TAG=fedora-26
OS=fedora
- DOCKER_TAG=fedora:25
OS_TAG=fedora-25
OS=fedora
- DOCKER_TAG=ubuntu:18.04
OS_TAG=ubuntu-18.04
OS=ubuntu
COMMAND=/bin/systemd --system
- DOCKER_TAG=ubuntu:16.04
OS_TAG=ubuntu-16.04
OS=ubuntu
COMMAND=/bin/systemd --system
before_install:
- sudo docker pull ${DOCKER_TAG}
install:
- sudo docker run --detach ${DOCKER_ARGS} -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup:ro --cap-add NET_ADMIN --cap-add SYS_ADMIN --device /dev/net/tun --volume="${PWD}":/etc/ansible/roles/ansible-role-openvpn:ro --name ${OS_TAG} ${DOCKER_TAG} ${COMMAND}
- ./tests/setup-${OS}
- sudo docker exec ${OS_TAG} ansible -m setup -c local -i 127.0.0.1, all
script:
# Check syntax of ansible playbook
- sudo docker exec ${OS_TAG} ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml --syntax-check
# Run ansible playbook
- sudo docker exec ${OS_TAG} ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv
after_script:
- sudo docker exec ${OS_TAG} cat /var/log/openvpn.log
- sudo docker stop ${OS_TAG}
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/