From 195f70897ca18faee18d63f006605af392572e8e Mon Sep 17 00:00:00 2001 From: liuxu Date: Thu, 26 Sep 2019 20:47:01 +0800 Subject: [PATCH] dashboard: add grafana dashboard support on Debian based OS download grafana dashboard files from github when running on Debian based OS Signed-off-by: liuxu --- group_vars/all.yml.sample | 13 +++++++++++++ group_vars/rhcs.yml.sample | 13 +++++++++++++ roles/ceph-defaults/defaults/main.yml | 13 +++++++++++++ roles/ceph-grafana/tasks/configure_grafana.yml | 9 +++++++++ site.yml.sample | 1 - 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 8ecb105e4..4005e5ca2 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -734,6 +734,19 @@ dummy: #grafana_uid: 472 #grafana_datasource: Dashboard #grafana_dashboards_path: "/etc/grafana/dashboards/ceph-dashboard" +#grafana_dashboard_version: master +#grafana_dashboard_files: +# - ceph-cluster.json +# - cephfs-overview.json +# - host-details.json +# - hosts-overview.json +# - osd-device-details.json +# - osds-overview.json +# - pool-detail.json +# - pool-overview.json +# - radosgw-detail.json +# - radosgw-overview.json +# - rbd-overview.json #grafana_plugins: # - vonage-status-panel # - grafana-piechart-panel diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index 479e6a2a4..2484c4f57 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -734,6 +734,19 @@ grafana_container_image: registry.redhat.io/openshift4/ose-grafana:v4.1 #grafana_uid: 472 #grafana_datasource: Dashboard #grafana_dashboards_path: "/etc/grafana/dashboards/ceph-dashboard" +#grafana_dashboard_version: master +#grafana_dashboard_files: +# - ceph-cluster.json +# - cephfs-overview.json +# - host-details.json +# - hosts-overview.json +# - osd-device-details.json +# - osds-overview.json +# - pool-detail.json +# - pool-overview.json +# - radosgw-detail.json +# - radosgw-overview.json +# - rbd-overview.json #grafana_plugins: # - vonage-status-panel # - grafana-piechart-panel diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index ef441451a..a96f10d80 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -726,6 +726,19 @@ grafana_container_memory: 4 grafana_uid: 472 grafana_datasource: Dashboard grafana_dashboards_path: "/etc/grafana/dashboards/ceph-dashboard" +grafana_dashboard_version: master +grafana_dashboard_files: + - ceph-cluster.json + - cephfs-overview.json + - host-details.json + - hosts-overview.json + - osd-device-details.json + - osds-overview.json + - pool-detail.json + - pool-overview.json + - radosgw-detail.json + - radosgw-overview.json + - rbd-overview.json grafana_plugins: - vonage-status-panel - grafana-piechart-panel diff --git a/roles/ceph-grafana/tasks/configure_grafana.yml b/roles/ceph-grafana/tasks/configure_grafana.yml index 70963491c..ce1dabe11 100644 --- a/roles/ceph-grafana/tasks/configure_grafana.yml +++ b/roles/ceph-grafana/tasks/configure_grafana.yml @@ -34,6 +34,15 @@ - "/etc/grafana/provisioning/dashboards" - "/etc/grafana/provisioning/notifiers" +- name: download ceph grafana dashboards + get_url: + url: "https://raw.githubusercontent.com/ceph/ceph/{{ grafana_dashboard_version }}/monitoring/grafana/dashboards/{{ item }}" + dest: "/etc/grafana/dashboards/ceph-dashboard/{{ item }}" + with_items: "{{ grafana_dashboard_files }}" + when: + - not containerized_deployment | bool + - not ansible_os_family in ['RedHat', 'Suse'] + - name: write grafana.ini template: src: grafana.ini.j2 diff --git a/site.yml.sample b/site.yml.sample index 7bb8b103b..fbf534b5d 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -485,4 +485,3 @@ when: - dashboard_enabled | bool - groups.get(grafana_server_group_name, []) | length > 0 - - ansible_os_family in ['RedHat', 'Suse']