This commit is contained in:
parent
18c9c75569
commit
ecc2c41afe
4 changed files with 45 additions and 18 deletions
|
|
@ -5,21 +5,30 @@
|
|||
# when:
|
||||
# - kubernetes_cni == "wireguard"
|
||||
|
||||
- name: Import Rancher key
|
||||
ansible.builtin.rpm_key:
|
||||
state: present
|
||||
key: https://rpm.rancher.io/public.key
|
||||
when:
|
||||
- ansible_os_family == "RedHat"
|
||||
|
||||
- name: Install the k3s-selinux rpm from a remote repo for yum distro
|
||||
yum:
|
||||
name: "https://github.com/k3s-io/k3s-selinux/releases/download/v0.2.stable.1/k3s-selinux-0.2-1.el7_8.noarch.rpm"
|
||||
name: "https://github.com/k3s-io/k3s-selinux/releases/download/v1.1.stable.1/k3s-selinux-1.1-1.el7.noarch.rpm"
|
||||
state: present
|
||||
disable_gpg_check: yes
|
||||
when:
|
||||
- ansible_pkg_mgr == "yum"
|
||||
- ansible_os_family == "RedHat"
|
||||
- ansible_distribution_major_version == '7'
|
||||
|
||||
- name: Install the k3s-selinux rpm from a remote repo for dnf distro
|
||||
dnf:
|
||||
name: "https://github.com/k3s-io/k3s-selinux/releases/download/v0.2.stable.1/k3s-selinux-0.2-1.el7_8.noarch.rpm"
|
||||
name: "https://github.com/k3s-io/k3s-selinux/releases/download/v1.1.stable.1/k3s-selinux-1.1-1.el8.noarch.rpm"
|
||||
state: present
|
||||
disable_gpg_check: yes
|
||||
when:
|
||||
- ansible_pkg_mgr == "dnf"
|
||||
- ansible_os_family == "RedHat"
|
||||
- ansible_distribution_major_version == '8'
|
||||
|
||||
- name: Check if /usr/local/bin/k3s already existe
|
||||
stat:
|
||||
|
|
@ -29,7 +38,7 @@
|
|||
|
||||
- name: retreive k3s binary for x86_64
|
||||
get_url:
|
||||
url: "https://github.com/rancher/k3s/releases/download/v1.23.2%2Bk3s1/k3s"
|
||||
url: "https://github.com/rancher/k3s/releases/download/v1.23.6%2Bk3s1/k3s"
|
||||
dest: "/usr/local/bin/k3s"
|
||||
group: root
|
||||
owner: root
|
||||
|
|
@ -40,7 +49,7 @@
|
|||
|
||||
- name: retreive k3s binary for arm64
|
||||
get_url:
|
||||
url: "https://github.com/rancher/k3s/releases/download/v1.23.2%2Bk3s1/k3s-arm64"
|
||||
url: "https://github.com/rancher/k3s/releases/download/v1.23.6%2Bk3s1/k3s-arm64"
|
||||
dest: "/usr/local/bin/k3s"
|
||||
group: root
|
||||
owner: root
|
||||
|
|
@ -51,7 +60,7 @@
|
|||
|
||||
- name: retreive k3s binary for armv6/armv7
|
||||
get_url:
|
||||
url: "https://github.com/rancher/k3s/releases/download/v1.23.2%2Bk3s1/k3s-armhf"
|
||||
url: "https://github.com/rancher/k3s/releases/download/v1.23.6%2Bk3s1/k3s-armhf"
|
||||
dest: "/usr/local/bin/k3s"
|
||||
group: root
|
||||
owner: root
|
||||
|
|
@ -140,14 +149,15 @@
|
|||
block:
|
||||
- name: Deploy systemd service
|
||||
template:
|
||||
src: "etc/systemd/system/{{ item }}.j2"
|
||||
dest: "/etc/systemd/system/{{ item }}"
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
with_items:
|
||||
- "k3s.service"
|
||||
- "k3s.service.env"
|
||||
- "etc/systemd/system/k3s.service"
|
||||
- "etc/systemd/system/k3s.service.env"
|
||||
- "etc/rancher/k3s/config.yaml"
|
||||
when:
|
||||
- ansible_service_mgr == "systemd"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue