diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml index 2359588b5..57994468c 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml @@ -5,7 +5,7 @@ state: directory owner: root group: root - mode: 0700 + mode: "{{ local_volume_provisioner_directory_mode }}" delegate_to: "{{ item[0] }}" with_nested: - "{{ groups['k8s-cluster'] }}" diff --git a/roles/kubernetes/preinstall/tasks/0050-create_directories.yml b/roles/kubernetes/preinstall/tasks/0050-create_directories.yml index 2e2c46184..91230c9de 100644 --- a/roles/kubernetes/preinstall/tasks/0050-create_directories.yml +++ b/roles/kubernetes/preinstall/tasks/0050-create_directories.yml @@ -69,7 +69,7 @@ state: directory owner: root group: root - mode: 0700 + mode: "{{ local_volume_provisioner_directory_mode }}" with_items: "{{ local_volume_provisioner_storage_classes.keys() | list }}" when: - inventory_hostname in groups['k8s-cluster'] diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 8a9478380..044ec27e8 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -279,6 +279,7 @@ registry_enabled: false metrics_server_enabled: false enable_network_policy: true local_volume_provisioner_enabled: "{{ local_volumes_enabled | default('false') }}" +local_volume_provisioner_directory_mode: 0700 persistent_volumes_enabled: false cephfs_provisioner_enabled: false rbd_provisioner_enabled: false