Fix k3s_server_location only working on default

- K3s has some absolute paths set in various places which cannot be
  changed. Using a symbolic link was the easiest fix. This is nice for
  running K3S on SBC that must boot to SD but K3S data should be stored
  on a faster drive.
- Other changes are for making the site playbook replayable without
  resetting the cluster. Ideally you can rerun it to check existing
  nodes or to add new ones.

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Nicholas Malcolm
2023-02-02 12:57:02 -05:00
committed by Derek Nola
parent 7cc70ad609
commit 8484c015d6
4 changed files with 30 additions and 15 deletions

View File

@@ -52,3 +52,17 @@
path: /etc/sudoers
validate: 'visudo -cf %s'
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux','RedHat']
- name: Make k3s directory
ansible.builtin.file:
path: "/var/lib/rancher"
mode: 0755
state: directory
- name: Create symlink
ansible.builtin.file:
dest: /var/lib/rancher/k3s
src: "{{ k3s_server_location }}"
force: true
state: link
when: k3s_server_location != "/var/lib/rancher/k3s"