48 lines
1.5 KiB
YAML
48 lines
1.5 KiB
YAML
---
|
|
- name: Include file list
|
|
include_vars: "longhorn.yaml"
|
|
|
|
- name: longhorn need to be present
|
|
block:
|
|
- name: Install files
|
|
k8s:
|
|
state: present
|
|
context: "{{ my_context }}"
|
|
merge_type: merge
|
|
namespace: longhorn-system
|
|
resource_definition: "{{ lookup('file', 'longhorn/' + item) | from_yaml }}"
|
|
with_items:
|
|
- "{{ storage_longhorn_files_list }}"
|
|
- name: Install Ingress for longhorn UI
|
|
k8s:
|
|
state: present
|
|
context: "{{ my_context }}"
|
|
merge_type: merge
|
|
namespace: longhorn-system
|
|
resource_definition: "{{ lookup('template', 'longhorn/' + item) | from_yaml }}"
|
|
with_items:
|
|
- "longhorn_ingressroute.yaml.j2"
|
|
when:
|
|
- storage_longhorn|bool
|
|
|
|
- name: longhorn need to be absent
|
|
block:
|
|
- name: Remove Ingress for longhorn UI
|
|
k8s:
|
|
state: absent
|
|
context: "{{ my_context }}"
|
|
namespace: longhorn-system
|
|
resource_definition: "{{ lookup('template', 'longhorn/' + item) | from_yaml }}"
|
|
with_items:
|
|
- "longhorn_ingressroute.yaml.j2"
|
|
- name: Remove files
|
|
k8s:
|
|
state: absent
|
|
context: "{{ my_context }}"
|
|
merge_type: merge
|
|
namespace: longhorn-system
|
|
resource_definition: "{{ lookup('file', 'longhorn/' + item) | from_yaml }}"
|
|
with_items:
|
|
- "{{ storage_longhorn_files_list | reverse | list }}"
|
|
when:
|
|
- not storage_longhorn|bool
|