File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 1
- k3s_version : " v1.31.0+k3s1" # Warning: changes to this variable won't be reflected in the cluster/image if k3s is already installed
1
+ # Warning: changes to these variables won't be reflected in the cluster/image if k3s is already installed
2
+ k3s_version : " v1.31.0+k3s1"
3
+ k3s_selinux_release : v1.6.latest.1
4
+ k3s_selinux_rpm_version : 1.6-1
5
+ rocky_version : " {{ ansible_distribution_major_version }}"
Original file line number Diff line number Diff line change 1
1
---
2
2
3
- - name : Check for existing k3s binaries
3
+ - name : Check for existing k3s installation
4
4
stat :
5
- path : /usr/bin /k3s
5
+ path : /var/lib/rancher /k3s
6
6
register : stat_result
7
7
8
- - name : Download and install k3s
8
+ - name : Download and air-gapped installation of k3s
9
9
when : not stat_result.stat.exists
10
10
block :
11
+
12
+ - name : Download k3s binary
13
+ ansible.builtin.get_url :
14
+ url : " https://github.com/k3s-io/k3s/releases/download/{{ k3s_version | urlencode }}/k3s"
15
+ dest : /usr/bin/k3s
16
+ owner : root
17
+ group : root
18
+ mode : " 0755"
19
+
20
+ - name : Install k3s SELinux policy package
21
+ yum :
22
+ name : " https://github.com/k3s-io/k3s-selinux/releases/download/{{ k3s_selinux_release }}/k3s-selinux-{{ k3s_selinux_rpm_version }}.el{{ rocky_version }}.noarch.rpm"
23
+ disable_gpg_check : true
24
+
25
+ - name : Create image directory
26
+ ansible.builtin.file :
27
+ path : " /var/lib/rancher/k3s/agent/images"
28
+ state : directory
29
+
30
+ - name : Install k3s' internal images
31
+ ansible.builtin.get_url :
32
+ url : " https://github.com/k3s-io/k3s/releases/download/{{ k3s_version | urlencode }}/k3s-airgap-images-amd64.tar.zst"
33
+ dest : /var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.zst
34
+
11
35
- name : Download k3s install script
12
36
ansible.builtin.get_url :
13
37
url : https://get.k3s.io/
26
50
INSTALL_K3S_SKIP_START : " true"
27
51
INSTALL_K3S_SKIP_ENABLE : " true"
28
52
INSTALL_K3S_BIN_DIR : " /usr/bin"
53
+ INSTALL_K3S_SKIP_DOWNLOAD : " true"
29
54
changed_when : true
30
55
loop :
31
56
- server --disable=traefik --node-label clusterrole=server
You can’t perform that action at this time.
0 commit comments