]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
Use grafana-cli to manage plugins
authorZack Cerza <zack@redhat.com>
Mon, 26 Jun 2017 18:11:01 +0000 (12:11 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 26 Jun 2017 19:11:05 +0000 (13:11 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
ansible/roles/ceph-grafana/tasks/grafana_plugins.yml

index 52de29b05ba28a00764a0a4ffafd6845e71f9b69..6d47748c99d35ba86158eaccb6c6edb476c56a3e 100644 (file)
@@ -1,28 +1,16 @@
 ---
-- name: Download Vonage Status Panel
-  get_url:
-    url: https://grafana.com/api/plugins/vonage-status-panel/versions/1.0.4/download
-    dest: /tmp/vonage.zip
-
 - name: Create Grafana plugins directory
   file:
     name: /var/lib/grafana/plugins
     state: directory
 
 - set_fact:
-    vonage_plugin_path: /var/lib/grafana/plugins/Vonage-Grafana_Status_panel
-
-- stat:
-    path: "{{ vonage_plugin_path }}"
-  register: vonage_plugin
+    grafana_plugins: "['vonage-status-panel']"
 
-- name: Unzip Vonage Status Panel
-  unarchive:
-    src: /tmp/vonage.zip
-    remote_src: true
-    dest: /var/lib/grafana/plugins/
-  when: vonage_plugin.stat.exists is defined and not vonage_plugin.stat.exists
+- name: Install Grafana plugins
+  command: "grafana-cli plugins install {{ item }}"
+  with_items: "{{ grafana_plugins }}"
 
-- name: Move Vonage Status Panel into place
-  shell: "mv -f {{ vonage_plugin_path }}* {{ vonage_plugin_path }}"
-  when: vonage_plugin.stat.exists is defined and not vonage_plugin.stat.exists
+- name: Update Grafana plugins
+  command: "grafana-cli plugins update {{ item }}"
+  with_items: "{{ grafana_plugins }}"