Update structure of local-path for install/remove

This commit is contained in:
Adrien Reslinger 2020-04-22 15:01:14 +02:00
parent aa28df3bf6
commit 7cb826a8f1
4 changed files with 32 additions and 121 deletions

27
tasks/local.yml Normal file
View file

@ -0,0 +1,27 @@
---
- name: Defined local-path-storage state to present
set_fact:
storage_localpath_state: present
when:
- storage_localpath|bool
- name: find state of local-path-storage
set_fact:
storage_localpath_state: absent
when:
- not storage_localpath|bool
- name: local-path-storage need to be {{ storage_localpath_state }}
k8s:
state: "{{ storage_localpath_state }}"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('file', item) | from_yaml }}"
with_items:
- "local/local-path-storage-Namespace.yaml"
- "local/local-path-provisioner-service-account-ServiceAccount.yaml"
- "local/local-path-provisioner-role-ClusterRole.yaml"
- "local/local-path-provisioner-bind-ClusterRoleBinding.yaml"
- "local/local-path-provisioner-Deployment.yaml"
- "local/local-path-StorageClass.yaml"
- "local/local-path-config-ConfigMap.yaml"