forked from kyl191/ansible-role-openvpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
48 lines (40 loc) · 1.49 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
---
language: python
sudo: required
services:
- docker
env:
global:
COMMAND=/usr/lib/systemd/systemd --system
matrix:
- DOCKER_TAG=centos:7
OS=centos
- DOCKER_TAG=fedora:latest
OS=fedora
- DOCKER_TAG=fedora:30
OS=fedora
- DOCKER_TAG=fedora:29
OS=fedora
- DOCKER_TAG=fedora:28
OS=fedora
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} ${DOCKER_TAG} ${COMMAND}
- ./tests/setup-${OS}
- sudo docker exec ${OS} ansible -m setup -c local -i 127.0.0.1, all
script:
# Check syntax of ansible playbook
- sudo docker exec ${OS} ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml --syntax-check
# Run ansible playbook
- sudo docker exec ${OS} ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv
# Check idempotency
- sudo docker exec ${OS} ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv
after_script:
- sudo docker exec ${OS} cat /var/log/openvpn.log
- sudo docker exec ${OS} ls /etc/openvpn
- sudo docker exec ${OS} cat /etc/openvpn/openvpn_udp_1194.conf
- sudo docker exec ${OS} cat /etc/openvpn/alpha-127.0.0.1.ovpn
- sudo docker stop ${OS}
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/