-
Notifications
You must be signed in to change notification settings - Fork 217
122 lines (116 loc) · 4.29 KB
/
ci.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
name: CI
on: # yamllint disable-line rule:truthy
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check-syntax:
runs-on: ubuntu-latest
name: check-syntax
container:
image: diodonfrost/ansible-fedora:40
env:
container: docker
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
- ${{ github.workspace }}:/etc/ansible/roles/ansible-role-openvpn
options: "--cap-add NET_ADMIN --cap-add SYS_ADMIN --device /dev/net/tun"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup ansible.posix collection for firewalld
run: ansible-galaxy collection install ansible.posix
- name: Setup community.general collection for ufw
run: ansible-galaxy collection install community.general
- name: Check syntax of ansible playbook
run: ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml --syntax-check
build-rhel-like:
runs-on: ubuntu-latest
name: rhel-like-${{ matrix.version }}
needs:
- check-syntax
strategy:
fail-fast: false
matrix:
version:
- "centos:stream9"
- "fedora:38"
- "fedora:39"
- "fedora:40"
- "almalinux:9"
- "rockylinux:9"
container:
image: diodonfrost/ansible-${{ matrix.version }}
env:
container: docker
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
- ${{ github.workspace }}:/etc/ansible/roles/ansible-role-openvpn
options: "--cap-add NET_ADMIN --cap-add SYS_ADMIN --device /dev/net/tun"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup ansible.posix collection for firewalld
run: ansible-galaxy collection install ansible.posix
- name: Setup community.general collection for ufw
run: ansible-galaxy collection install community.general
- name: Make sure ansible connection is sane
run: ansible -m setup -c local -i 127.0.0.1, all
- name: Run ansible playbook
run: ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv
- name: Check idempotency
run: ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv
- name: Container state debug output
continue-on-error: true
run: |
ls -lR /etc/openvpn
echo "cat openvpn_udp_1194.conf"
find /etc/openvpn/ -maxdepth 3 -name openvpn_udp_1194.conf -type f -exec cat {} \;
echo "cat alpha-*.ovpn"
find /etc/openvpn/ -maxdepth 3 -name "alpha-*.ovpn" -type f -exec cat {} \;
build-rhel-legacy:
runs-on: ubuntu-latest
name: rhel-legacy-${{ matrix.version }}
needs:
- check-syntax
strategy:
fail-fast: false
matrix:
version:
- "almalinux:8"
- "rockylinux:8"
container:
image: diodonfrost/ansible-${{ matrix.version }}
env:
container: docker
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
- ${{ github.workspace }}:/etc/ansible/roles/ansible-role-openvpn
options: "--cap-add NET_ADMIN --cap-add SYS_ADMIN --device /dev/net/tun"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update ansible
run: dnf install python39 && pip3.9 install -U ansible
- name: Setup ansible.posix collection for firewalld
run: ansible-galaxy collection install ansible.posix
- name: Setup community.general collection for ufw
run: ansible-galaxy collection install community.general
- name: Make sure ansible connection is sane
run: ansible -m setup -c local -i 127.0.0.1, all
- name: Run ansible playbook
run: ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv
- name: Check idempotency
run: ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv
- name: Container state debug output
continue-on-error: true
run: |
ls -lR /etc/openvpn
echo "cat openvpn_udp_1194.conf"
find /etc/openvpn/ -maxdepth 3 -name openvpn_udp_1194.conf -type f -exec cat {} \;
echo "cat alpha-*.ovpn"
find /etc/openvpn/ -maxdepth 3 -name "alpha-*.ovpn" -type f -exec cat {} \;