Add mounting disks to k8s for longhorn

This commit is contained in:
Amarpreet Minhas 2022-12-29 00:19:12 -05:00
parent f84098dec8
commit 8c715171ff
3 changed files with 14 additions and 5 deletions

View file

@ -0,0 +1,3 @@
---
k3s_version: v1.24.8+k3s1
kube_storage: False

View file

@ -13,9 +13,4 @@
enabled: yes
name: k3s
state: started
- name: ensure nfsd is installed
apt:
name: nfs-common
state: present
...

View file

@ -4,6 +4,8 @@
name:
- apparmor
- apparmor-utils
- nfs-common
- open-iscsi
- name: check k3s version
shell:
@ -21,6 +23,7 @@
mode: 0755
owner: root
group: root
force: True
when: installed_k3s_version.stdout != k3s_version
notify: restart k3s
@ -45,4 +48,12 @@
owner: root
group: root
mode: 0644
- name: ensure mount is configured
ansible.posix.mount:
path: /mnt/storage
src: /dev/nvme0n1p1
fstype: ext4
state: mounted
when: kube_storage
...