82 lines
2.7 KiB
YAML
82 lines
2.7 KiB
YAML
---
|
|
- name: longhorn need to be present
|
|
block:
|
|
- name: Defined longhorn repository
|
|
community.kubernetes.helm_repository:
|
|
name: longhorn
|
|
repo_url: "https://charts.longhorn.io"
|
|
- name: Deploy latest version of longhorn
|
|
community.kubernetes.helm:
|
|
context: "{{ my_context }}"
|
|
name: longhorn
|
|
chart_ref: longhorn/longhorn
|
|
# chart_version: 1.1.0
|
|
create_namespace: yes
|
|
release_namespace: "{{ storage_longhorn_namespace }}"
|
|
values:
|
|
defaultSettings:
|
|
defaultDataPath: "/var/lib/longhorn/"
|
|
tags:
|
|
- longhorn
|
|
- storage
|
|
- name: Install longhorn UI Ingress
|
|
k8s:
|
|
state: present
|
|
context: "{{ my_context }}"
|
|
apply: true
|
|
namespace: "{{ storage_longhorn_namespace }}"
|
|
resource_definition: "{{ lookup('template', 'longhorn/' + item) | from_yaml }}"
|
|
with_items:
|
|
- "longhorn_ingressroute.yaml.j2"
|
|
when:
|
|
- storage_longhorn|bool
|
|
tags:
|
|
- longhorn
|
|
- storage
|
|
|
|
- name: longhorn need to be absent
|
|
block:
|
|
- name: Deploy latest version of longhorn
|
|
community.kubernetes.helm:
|
|
context: "{{ my_context }}"
|
|
name: longhorn
|
|
chart_ref: longhorn/longhorn
|
|
# chart_version: 1.1.0
|
|
release_state: absent
|
|
release_namespace: "{{ storage_longhorn_namespace }}"
|
|
values:
|
|
defaultSettings:
|
|
defaultDataPath: "/var/lib/longhorn/"
|
|
backupTarget: "nfs://longhorn-test-nfs-svc.default:/opt/backupstore"
|
|
|
|
# ingress:
|
|
# enabled: false
|
|
# host: xip.io
|
|
# tls: false
|
|
# tlsSecret: longhorn.local-tls
|
|
# annotations:
|
|
# kubernetes.io/ingress.class: nginx
|
|
# kubernetes.io/tls-acme: true
|
|
#{% if ingress_whitelist is defined %}
|
|
# ingress.kubernetes.io/whitelist-source-range: "{% for acl_whitelist in ingress_whitelist %}{{ acl_whitelist }}{% if not loop.last %}, {% endif %}{% endfor %}"
|
|
#{% endif %}
|
|
# traefik.frontend.priority: "10"
|
|
# traefik.frontend.redirect.entryPoint: https
|
|
#{% if basic_auth is defined %}
|
|
# traefik.ingress.kubernetes.io/auth-secret: basic-auth
|
|
# traefik.ingress.kubernetes.io/auth-type: basic
|
|
#{% endif %}
|
|
- name: Remove Ingress for longhorn UI
|
|
k8s:
|
|
state: absent
|
|
context: "{{ my_context }}"
|
|
namespace: "{{ storage_longhorn_namespace }}"
|
|
resource_definition: "{{ lookup('template', 'longhorn/' + item) | from_yaml }}"
|
|
with_items:
|
|
- "longhorn_ingressroute.yaml.j2"
|
|
- "longhorn-namespace.yml.j2"
|
|
when:
|
|
- not storage_longhorn|bool
|
|
tags:
|
|
- longhorn
|
|
- storage
|