summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-09-16 13:39:33 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-09-16 13:39:33 +0200
commit29c158ab71685c1eefc76f8dc7d56ef6e6abccbc (patch)
tree35799221666d4121c34423674625143db6d4a47c /ansible
parentfb661ce7716c43be3c6e8b86622e5934388e3e30 (diff)
[ANSIBLE] Provision custom Grafana Home dashboard
Change-Id: I85e096cbecf24c2b6914b60ec97a4f056d18bd1e Issue-ID: OOM-2833 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/kube-prometheus-stack/defaults/main.yml5
-rw-r--r--ansible/roles/kube-prometheus-stack/tasks/main.yml7
2 files changed, 9 insertions, 3 deletions
diff --git a/ansible/roles/kube-prometheus-stack/defaults/main.yml b/ansible/roles/kube-prometheus-stack/defaults/main.yml
index 53685bec..8803b802 100644
--- a/ansible/roles/kube-prometheus-stack/defaults/main.yml
+++ b/ansible/roles/kube-prometheus-stack/defaults/main.yml
@@ -1,12 +1,17 @@
---
kube_prometheus_stack:
k8s_namespace: kube-prometheus
+ grafana_dashboards:
+ - { src: "grafana_dashboard.json", dest: "{{ nfs_mount_path }}/kube-prometheus/kube-prometheus-grafana/dashboards/custom/" }
+ - { src: "grafana_home.json", dest: "{{ nfs_mount_path }}/kube-prometheus/kube-prometheus-grafana/dashboards/" }
helm_release_name: kube-prometheus-stack
helm_timeout: "240s"
helm_values_file: "{{ app_data_path }}/kube_prometheus_values.yaml"
helm_values:
grafana:
adminPassword: grafana
+ env:
+ GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/grafana_home.json
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
diff --git a/ansible/roles/kube-prometheus-stack/tasks/main.yml b/ansible/roles/kube-prometheus-stack/tasks/main.yml
index e190b758..08629e38 100644
--- a/ansible/roles/kube-prometheus-stack/tasks/main.yml
+++ b/ansible/roles/kube-prometheus-stack/tasks/main.yml
@@ -10,10 +10,11 @@
dest: "{{ kube_prometheus_stack.helm_values_file }}"
content: "{{ kube_prometheus_stack.helm_values | combine(kube_prometheus_helm_values | default({}), recursive=True) | to_nice_yaml }}"
-- name: Upload custom Grafana dashboard
+- name: Upload Grafana dashboards
copy:
- src: grafana_dashboard.json
- dest: "{{ nfs_mount_path }}/kube-prometheus/kube-prometheus-grafana/dashboards/custom/"
+ src: "{{ item.src }}"
+ dest: "{{ item.dest }}"
+ loop: "{{ kube_prometheus_stack.grafana_dashboards }}"
- name: "Install Helm release {{ kube_prometheus_stack.helm_release_name }}"
community.kubernetes.helm: