ansible-role-k8s-storage/tasks/linode.yml
Adrien 2be4c03df1
All checks were successful
continuous-integration/drone/push Build is passing
Update from upstream
2020-10-10 13:11:17 +02:00

40 lines
1.1 KiB
YAML

---
# https://github.com/linode/linode-blockstorage-csi-driver
- name: Include file list
include_vars: "linode.yaml"
- 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:
- "{{ storage_linode_files_list }}"