---
- name: check if grafana is already installed
shell:
- cmd: helm status mec-grafana
+ cmd: helm status grafana
register: result
- failed_when: false
+ ignore_errors: yes
no_log: True
- debug:
- msg: Grafana is already present
- when: result.rc == 0
+ msg: grafana is already present
+ when: result.stdout != ""
-- meta: end_play
- when: result.rc == 0
+- debug:
+# yamllint disable rule:line-length
+ msg: Ignore Uninstall Log , Grafana not installed continue with Installation
+# yamllint disable rule:line-length
+ when: result.stdout == ""
+
+- name: "INSTALL: Add Grafana Repo on x86"
+ shell:
+ cmd: helm repo add grafana https://grafana.github.io/helm-charts
+ when: result is failed and ansible_architecture == 'x86_64'
+ ignore_errors: yes
+
+- name: "INSTALL: Update helm repo"
+ shell:
+ cmd: helm repo update
+ when: result is failed and ansible_architecture == 'x86_64'
+ ignore_errors: yes
-- name: Install grafana on x86_64
+- name: "INSTALL: Install grafana on x86_64"
shell:
- cmd: helm install mec-grafana stable/grafana
+ cmd: helm install grafana grafana/grafana
when: result is failed and ansible_architecture == 'x86_64'
+ ignore_errors: yes
-- name: copy values.yaml to host
+- name: "INSTALL: copy values.yaml to host"
copy:
src: values.yaml
dest: /tmp/grafana/
when: result is failed and ansible_architecture == 'aarch64'
-- name: Install grafana on aarch64
+- name: "INSTALL: Install grafana on aarch64"
shell:
- cmd: helm install mec-grafana stable/grafana -f /tmp/grafana/values.yaml
+ cmd: helm install grafana stable/grafana -f /tmp/grafana/values.yaml
when: result is failed and ansible_architecture == 'aarch64'