Add mounting disks to k8s for longhorn
This commit is contained in:
parent
f84098dec8
commit
8c715171ff
3 changed files with 14 additions and 5 deletions
3
ansible/roles/k3s/defaults/main.yml
Normal file
3
ansible/roles/k3s/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
k3s_version: v1.24.8+k3s1
|
||||||
|
kube_storage: False
|
|
@ -13,9 +13,4 @@
|
||||||
enabled: yes
|
enabled: yes
|
||||||
name: k3s
|
name: k3s
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: ensure nfsd is installed
|
|
||||||
apt:
|
|
||||||
name: nfs-common
|
|
||||||
state: present
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
name:
|
name:
|
||||||
- apparmor
|
- apparmor
|
||||||
- apparmor-utils
|
- apparmor-utils
|
||||||
|
- nfs-common
|
||||||
|
- open-iscsi
|
||||||
|
|
||||||
- name: check k3s version
|
- name: check k3s version
|
||||||
shell:
|
shell:
|
||||||
|
@ -21,6 +23,7 @@
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
force: True
|
||||||
when: installed_k3s_version.stdout != k3s_version
|
when: installed_k3s_version.stdout != k3s_version
|
||||||
notify: restart k3s
|
notify: restart k3s
|
||||||
|
|
||||||
|
@ -45,4 +48,12 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
|
- name: ensure mount is configured
|
||||||
|
ansible.posix.mount:
|
||||||
|
path: /mnt/storage
|
||||||
|
src: /dev/nvme0n1p1
|
||||||
|
fstype: ext4
|
||||||
|
state: mounted
|
||||||
|
when: kube_storage
|
||||||
...
|
...
|
||||||
|
|
Loading…
Reference in a new issue