From: Zack Cerza Date: Thu, 22 Jun 2017 20:06:07 +0000 (-0600) Subject: ceph-grafana: Split out plugin installation X-Git-Tag: v1.0~67^2~1^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c63e14ffefa0a440459a9559c6a4fb7a38ee417;p=cephmetrics.git ceph-grafana: Split out plugin installation Signed-off-by: Zack Cerza --- diff --git a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml index 20b1a11..a0110db 100644 --- a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml +++ b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml @@ -71,34 +71,7 @@ tags: [ini] notify: Restart Grafana -- 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 - -- 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: 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 - notify: Restart Grafana +- include: grafana_plugins.yml - name: Ship dashboard templates copy: diff --git a/ansible/roles/ceph-grafana/tasks/grafana_plugins.yml b/ansible/roles/ceph-grafana/tasks/grafana_plugins.yml new file mode 100644 index 0000000..74b845e --- /dev/null +++ b/ansible/roles/ceph-grafana/tasks/grafana_plugins.yml @@ -0,0 +1,29 @@ +--- +- 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 + +- 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: 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 + notify: Restart Grafana