Fix directories creation
This commit is contained in:
parent
21f4c81832
commit
1611c091e6
1 changed files with 11 additions and 2 deletions
|
|
@ -189,7 +189,7 @@
|
||||||
- name: Configure first controler
|
- name: Configure first controler
|
||||||
# run_once: true
|
# run_once: true
|
||||||
block:
|
block:
|
||||||
- name: Create k3s directories
|
- name: Create k3s directories on master nodes
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
@ -204,10 +204,19 @@
|
||||||
- "/var/lib/rancher/k3s"
|
- "/var/lib/rancher/k3s"
|
||||||
- "/var/lib/rancher/k3s/server"
|
- "/var/lib/rancher/k3s/server"
|
||||||
- "/var/lib/rancher/k3s/server/manifests"
|
- "/var/lib/rancher/k3s/server/manifests"
|
||||||
- "/var/lib/rancher/k3s/storage"
|
|
||||||
when:
|
when:
|
||||||
- kubernetes_master|bool
|
- kubernetes_master|bool
|
||||||
|
|
||||||
|
- name: Create k3s directories on all nodes
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0700
|
||||||
|
with_items:
|
||||||
|
- "/var/lib/rancher/k3s/storage"
|
||||||
|
|
||||||
# semanage fcontext -a -t container_file_t "/var/lib/rancher/k3s/storage(/.*)?"
|
# semanage fcontext -a -t container_file_t "/var/lib/rancher/k3s/storage(/.*)?"
|
||||||
- name: Allow K3S local-path provisioner to create directories in /var/lib/rancher/k3s/storage
|
- name: Allow K3S local-path provisioner to create directories in /var/lib/rancher/k3s/storage
|
||||||
community.general.sefcontext:
|
community.general.sefcontext:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue