From 071a5c6382fd9141fe9265296f475ec6a6b16fca Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Sun, 30 Oct 2022 16:46:05 +0100 Subject: [PATCH] moved k3s binary to /opt --- hosts.yml | 6 ++++++ roles/k3s/tasks/main.yml | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/hosts.yml b/hosts.yml index 4b70338..d13585c 100644 --- a/hosts.yml +++ b/hosts.yml @@ -86,6 +86,12 @@ all: opts: "subvol=home,noatime" passno: "0" + - src: "/dev/mapper/disk0" + path: "/opt" + fstype: "btrfs" + opts: "subvol=opt,noatime" + passno: "0" + - src: "/dev/mapper/disk0" path: "/var/lib/builder/src" fstype: "btrfs" diff --git a/roles/k3s/tasks/main.yml b/roles/k3s/tasks/main.yml index 368deb8..d585af6 100644 --- a/roles/k3s/tasks/main.yml +++ b/roles/k3s/tasks/main.yml @@ -4,19 +4,25 @@ set_fact: k3s_suffix: "{{ k3s_suffix_lookup[ansible_architecture] }}" +- name: create k3s opt directory + file: + path: /opt/k3s + state: directory + - name: download k3s binary get_url: url: "{{ k3s_download_base_url }}/k3s{{ k3s_suffix }}" - dest: /usr/local/bin/k3s + dest: /opt/k3s/k3s checksum: "sha256:{{ k3s_download_base_url }}/sha256sum{{ k3s_suffix }}.txt" mode: '0755' - name: create k3s symlinks file: state: link - src: /usr/local/bin/k3s + src: /opt/k3s/k3s dest: "/usr/local/bin/{{ item }}" loop: + - k3s - kubectl - crictl - ctr @@ -65,6 +71,5 @@ - /usr/local/bin/kubectl - /usr/local/bin/crictl - /usr/local/bin/ctr - - /etc/rancher/k3s/k3s.env - /etc/init.d/k3s when: ansible_distribution == "Alpine" and alpine_mode in ["diskless", "data"]