diff options
author | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2021-09-16 13:39:33 +0200 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2021-09-17 07:24:08 +0000 |
commit | 527a1e7493e30bc01a4b1384ce215ddce9cef58c (patch) | |
tree | 031711dc93949655b59e3f8d785e474deea851a6 /ansible/roles | |
parent | 5d265491f9aa0e0a5cd8d7fbcf203bbebc5b7d6d (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/roles')
-rw-r--r-- | ansible/roles/kube-prometheus-stack/defaults/main.yml | 5 | ||||
-rw-r--r-- | ansible/roles/kube-prometheus-stack/tasks/main.yml | 7 |
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: |