]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
Set home dashboard
authorBoris Ranto <branto@redhat.com>
Thu, 19 Apr 2018 20:36:42 +0000 (22:36 +0200)
committerBoris Ranto <branto@redhat.com>
Thu, 19 Apr 2018 21:35:25 +0000 (23:35 +0200)
Signed-off-by: Boris Ranto <branto@redhat.com>
ansible/roles/ceph-grafana/tasks/push_dashboards.yml

index 8a691bd7dc86ec5e5eb416ffcc755970e1073b01..a19adc70e12769c5bc52204479ff460e67190841 100644 (file)
     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 }} }'