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 11---
22
3- - name : Check for existing k3s binaries
3+ - name : Check for existing k3s installation
44 stat :
5- path : /usr/bin /k3s
5+ path : /var/lib/rancher /k3s
66 register : stat_result
77
8- - name : Download and install k3s
8+ - name : Download and air-gapped installation of k3s
99 when : not stat_result.stat.exists
1010 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+
1135 - name : Download k3s install script
1236 ansible.builtin.get_url :
1337 url : https://get.k3s.io/
2650 INSTALL_K3S_SKIP_START : " true"
2751 INSTALL_K3S_SKIP_ENABLE : " true"
2852 INSTALL_K3S_BIN_DIR : " /usr/bin"
53+ INSTALL_K3S_SKIP_DOWNLOAD : " true"
2954 changed_when : true
3055 loop :
3156 - server --disable=traefik --node-label clusterrole=server
You can’t perform that action at this time.
0 commit comments