summaryrefslogtreecommitdiffstats
path: root/ansible/roles/kube-prometheus-stack
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/kube-prometheus-stack')
-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: