54 lines
2.1 KiB
YAML
54 lines
2.1 KiB
YAML
---
|
|
# https://github.com/linode/linode-blockstorage-csi-driver
|
|
- name: Defined linode-storage state to present
|
|
set_fact:
|
|
storage_linode_state: present
|
|
when:
|
|
- storage_linode|bool
|
|
|
|
- name: find state of linode-storage
|
|
set_fact:
|
|
storage_linode_state: absent
|
|
when:
|
|
- not storage_linode|bool
|
|
|
|
- name: Add secret for Linode Access Key
|
|
k8s:
|
|
state: "{{ storage_linode_state }}"
|
|
context: "{{ my_context }}"
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: linode
|
|
namespace: kube-system
|
|
type: Opaque
|
|
stringData:
|
|
token: "{{ LINODE_TOKEN | default('token_missing')}}"
|
|
region: "{{ LINODE_REGION | default('token_missing')}}"
|
|
|
|
- name: linode-storage need to be {{ storage_linode_state }}
|
|
k8s:
|
|
state: "{{ storage_linode_state }}"
|
|
context: "{{ my_context }}"
|
|
merge_type: merge
|
|
resource_definition: "{{ lookup('file', item) | from_yaml }}"
|
|
with_items:
|
|
- "linode/csinodeinfos.csi.storage.k8s.io-CustomResourceDefinition.yaml"
|
|
- "linode/csidrivers.csi.storage.k8s.io-CustomResourceDefinition.yaml"
|
|
- "linode/csi-node-sa-ServiceAccount.yaml"
|
|
- "linode/driver-registrar-role-ClusterRole.yaml"
|
|
- "linode/driver-registrar-binding-ClusterRoleBinding.yaml"
|
|
- "linode/csi-controller-sa-ServiceAccount.yaml"
|
|
- "linode/external-provisioner-role-ClusterRole.yaml"
|
|
- "linode/csi-controller-provisioner-binding-ClusterRoleBinding.yaml"
|
|
- "linode/external-attacher-role-ClusterRole.yaml"
|
|
- "linode/csi-controller-attacher-binding-ClusterRoleBinding.yaml"
|
|
- "linode/external-snapshotter-role-ClusterRole.yaml"
|
|
- "linode/csi-controller-snapshotter-binding-ClusterRoleBinding.yaml"
|
|
- "linode/linodebs.csi.linode.com-CSIDriver.yaml"
|
|
- "linode/linode-block-storage-StorageClass.yaml"
|
|
- "linode/linode-block-storage-retain-StorageClass.yaml"
|
|
- "linode/csi-linode-controller-StatefulSet.yaml"
|
|
- "linode/csi-linode-node-DaemonSet.yaml"
|
|
- "linode/get-linode-id-ConfigMap.yaml"
|