38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
---
|
|
- name: Helm | Add Grafana chart repository
|
|
ansible.builtin.command: helm repo add grafana https://grafana.github.io/helm-charts
|
|
environment:
|
|
KUBECONFIG: "{{ logging_kubeconfig }}"
|
|
PATH: "/usr/local/bin:/usr/bin:/bin"
|
|
register: _helm_repo_add
|
|
changed_when: "'already exists' not in _helm_repo_add.stdout"
|
|
failed_when: _helm_repo_add.rc != 0 and 'already exists' not in _helm_repo_add.stdout
|
|
|
|
- name: Helm | Update chart repositories
|
|
ansible.builtin.command: helm repo update
|
|
environment:
|
|
KUBECONFIG: "{{ logging_kubeconfig }}"
|
|
PATH: "/usr/local/bin:/usr/bin:/bin"
|
|
changed_when: false
|
|
|
|
- name: Loki | Render Loki values
|
|
ansible.builtin.template:
|
|
src: loki-values.yml.j2
|
|
dest: /tmp/loki-values.yml
|
|
mode: "0600"
|
|
|
|
- name: Loki | Install or upgrade Loki
|
|
ansible.builtin.command: >
|
|
helm upgrade --install loki grafana/loki
|
|
--namespace {{ logging_namespace }}
|
|
--version {{ loki_chart_version }}
|
|
--values /tmp/loki-values.yml
|
|
--set loki.storage.s3.secret_access_key={{ loki_minio_password }}
|
|
--timeout 10m0s
|
|
--wait
|
|
environment:
|
|
KUBECONFIG: "{{ logging_kubeconfig }}"
|
|
PATH: "/usr/local/bin:/usr/bin:/bin"
|
|
register: _helm_install
|
|
changed_when: "'STATUS: deployed' in _helm_install.stdout or 'has been upgraded' in _helm_install.stdout"
|