-
Notifications
You must be signed in to change notification settings - Fork 38
156 lines (102 loc) · 5.4 KB
/
main.yaml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
name: CI
on:
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test-kubeadm:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Install python
run: sudo apt update && sudo apt install -y python3 python3-pip python3-setuptools
- name: Remove pre-installed kubectl to avoid errors
run: sudo apt remove kubectl buildah podman -y
- name: Install Ansible
run: sudo pip3 install dnspython ansible==2.9.22
- name: Create ansible.cfg with correct roles_path
run: sudo printf '[defaults]\nhost_key_checking = False\nroles_path=../' > ansible.cfg
- name: Install geerlingguy.ntp
run: sudo ansible-galaxy install geerlingguy.ntp grycap.docker grycap.cri_o
- name: Basic role syntax check
run: sudo ansible-playbook tests/test.yml -i tests/inventory --syntax-check
- name: Basic role check in front
run: sudo ansible-playbook tests/test.yml -i tests/inventory
- name: Basic role check in wn
run: sudo ansible-playbook tests/test.yml -i tests/inventory -e kube_type_of_node=wn -e kube_server=localhost
- name: Test nodes
run: sudo kubectl -s https://localhost:6443 --insecure-skip-tls-verify --kubeconfig /etc/kubernetes/admin.conf get nodes
test-k3s:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Install python
run: sudo apt update && sudo apt install -y python3 python3-pip python3-setuptools
- name: Remove pre-installed kubectl to avoid errors
run: sudo apt remove kubectl buildah podman -y
- name: Install Ansible
run: sudo pip3 install ansible==2.9.22
- name: Create ansible.cfg with correct roles_path
run: sudo printf '[defaults]\nhost_key_checking = False\nroles_path=../' > ansible.cfg
- name: Install geerlingguy.ntp
run: sudo ansible-galaxy install geerlingguy.ntp grycap.docker grycap.cri_o
- name: Basic role syntax check
run: sudo ansible-playbook tests/test.yml -i tests/inventory --syntax-check
- name: Basic role check in front
run: sudo ansible-playbook tests/test.yml -i tests/inventory -e kube_install_metrics=false -e kube_install_method=k3s -e kube_version=v1.25.2+k3s1
# - name: Basic role check in wn
# run: sudo ansible-playbook tests/test.yml -i tests/inventory -e kube_type_of_node=wn -e kube_server=localhost -e kube_install_method=k3s -e kube_version=v1.25.2+k3s1 -e kube_k3_exec='--lb-server-port=6445'
- name: Test nodes
run: sudo kubectl -s https://localhost:6443 --insecure-skip-tls-verify --kubeconfig /etc/rancher/k3s/k3s.yaml get nodes
test-crio:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Install python
run: sudo apt update && sudo apt install -y python3 python3-pip python3-setuptools
- name: Remove pre-installed kubectl to avoid errors
run: sudo apt remove kubectl buildah podman -y
- name: Stop containerd
run: sudo systemctl stop containerd; sudo rm -f /var/run/containerd/containerd.sock
- name: Install Ansible
run: sudo pip3 install ansible==2.9.22
- name: Create ansible.cfg with correct roles_path
run: sudo printf '[defaults]\nhost_key_checking = False\nroles_path=../' > ansible.cfg
- name: Install geerlingguy.ntp
run: sudo ansible-galaxy install geerlingguy.ntp grycap.docker grycap.cri_o
- name: Basic role syntax check
run: sudo ansible-playbook tests/test-crio.yml -i tests/inventory --syntax-check
- name: Basic role check in front
run: sudo ansible-playbook tests/test-crio.yml -i tests/inventory
- name: Basic role check in wn
run: sudo ansible-playbook tests/test-crio.yml -i tests/inventory -e kube_type_of_node=wn -e kube_server=localhost
- name: Test nodes
run: sudo kubectl -s https://localhost:6443 --insecure-skip-tls-verify --kubeconfig /etc/kubernetes/admin.conf get nodes
test-docker:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Install python
run: sudo apt update && sudo apt install -y python3 python3-pip python3-setuptools
- name: Remove pre-installed kubectl to avoid errors
run: sudo apt remove kubectl buildah podman -y
- name: Install Ansible
run: sudo pip3 install dnspython ansible==2.9.22
- name: Create ansible.cfg with correct roles_path
run: sudo printf '[defaults]\nhost_key_checking = False\nroles_path=../' > ansible.cfg
- name: Install geerlingguy.ntp
run: sudo ansible-galaxy install geerlingguy.ntp grycap.docker grycap.cri_o
- name: Basic role syntax check
run: sudo ansible-playbook tests/test-docker.yml -i tests/inventory --syntax-check
- name: Basic role check in front
run: sudo ansible-playbook tests/test-docker.yml -i tests/inventory
- name: Basic role check in wn
run: sudo ansible-playbook tests/test-docker.yml -i tests/inventory -e kube_type_of_node=wn -e kube_server=localhost
- name: Test nodes
run: sudo kubectl -s https://localhost:6443 --insecure-skip-tls-verify --kubeconfig /etc/kubernetes/admin.conf get nodes