From: Boris Ranto Date: Thu, 19 Apr 2018 20:36:42 +0000 (+0200) Subject: Set home dashboard X-Git-Tag: v2.0~36^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2110ce2334fcd887439a85a6621340bf7ea675e5;p=cephmetrics.git Set home dashboard Signed-off-by: Boris Ranto --- diff --git a/ansible/roles/ceph-grafana/tasks/push_dashboards.yml b/ansible/roles/ceph-grafana/tasks/push_dashboards.yml index 8a691bd..a19adc7 100644 --- a/ansible/roles/ceph-grafana/tasks/push_dashboards.yml +++ b/ansible/roles/ceph-grafana/tasks/push_dashboards.yml @@ -65,3 +65,26 @@ body_format: json body: '{"dashboard": {{ dashboards[item].body|to_json }}, "overwrite": true}' with_items: "{{ dashboards.keys() }}" + +# We need the home dashboard info for its ID +- name: Get home dashboard info + uri: + url: "http://localhost:3000/api/dashboards/db/ceph-at-a-glance" + method: GET + user: "{{ grafana.user }}" + password: "{{ grafana.admin_password }}" + force_basic_auth: yes + status_code: 200 + register: dashboard_home + no_log: true + +- name: Set the home dashboard + uri: + url: http://localhost:3000/api/org/preferences + method: PUT + user: "{{ grafana.user }}" + password: "{{ grafana.admin_password }}" + force_basic_auth: yes + status_code: 200 + body_format: json + body: '{"homeDashboardId": {{ dashboard_home.json.dashboard.id }} }'