ansible-role-k8s-storage/tasks/main.yml
Adrien Reslinger adca04dadf First release
2020-03-16 15:34:32 +01:00

39 lines
1.2 KiB
YAML

- name: Local Path setup
block:
- name: namespace
k8s:
context: "{{ my_context }}"
state: present
name: kubernetes-dashboard
api_version: v1
kind: Namespace
- name: dashboard install
k8s:
state: present
context: "{{ my_context }}"
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"
when:
- storage_localpath == true
- name: Select the default StorageClass
k8s:
state: present
context: "{{ my_context }}"
definition:
apiVersion: v1
kind: StorageClass
metadata:
name: "{{ storage_default_storageclass }}"
annotations:
storageclass.kubernetes.io/is-default-class: "true"
when:
- storage_default_storageclass is defined