32 lines
1.2 KiB
YAML
32 lines
1.2 KiB
YAML
---
|
|
# https://github.com/kubernetes-incubator/external-storage/blob/master/nfs/docs/deployment.md
|
|
# Ne pas oublier de "sudo chcon -Rt svirt_sandbox_file_t /srv" pour le stockage
|
|
# ou alors tourner le container en privileged
|
|
- name: Defined nfs-provisioner state to present
|
|
set_fact:
|
|
storage_nfs_state: present
|
|
when:
|
|
- storage_nfs|bool
|
|
|
|
- name: find state of nfs-provisioner
|
|
set_fact:
|
|
storage_nfs_state: absent
|
|
when:
|
|
- not storage_nfs|bool
|
|
|
|
- name: nfs-provisioner need to be {{ storage_nfs_state }}
|
|
k8s:
|
|
state: "{{ storage_nfs_state }}"
|
|
context: "{{ my_context }}"
|
|
merge_type: merge
|
|
resource_definition: "{{ lookup('file', item) | from_yaml }}"
|
|
with_items:
|
|
- "nfs/nfs-provisioner-PodSecurityPolicy.yaml"
|
|
- "nfs/nfs-provisioner-runner-ClusterRole.yaml"
|
|
- "nfs/run-nfs-provisioner-ClusterRoleBinding.yaml"
|
|
- "nfs/leader-locking-nfs-provisioner-Role.yaml"
|
|
- "nfs/leader-locking-nfs-provisioner-RoleBinding.yaml"
|
|
- "nfs/nfs-provisioner-ServiceAccount.yaml"
|
|
- "nfs/nfs-provisioner-Service.yaml"
|
|
- "nfs/nfs-provisioner-Deployment.yaml"
|
|
- "nfs/example-nfs-StorageClass.yaml"
|