Skip to content
Snippets Groups Projects
Unverified Commit fc2c9f06 authored by Paweł Krupa's avatar Paweł Krupa Committed by GitHub
Browse files

Merge pull request #92 from cloudalchemy/resolve_77

[patch] Use curl instead of get_url to download dashboards
parents 72992820 d99c26a5
Branches
Tags 0.11.1
No related merge requests found
......@@ -8,20 +8,38 @@
delegate_to: localhost
run_once: true
- name: download grafana dashboard from grafana.net to local folder
# - name: download grafana dashboard from grafana.net to local folder
# become: false
# get_url:
# url: "https://grafana.com/api/dashboards/{{ item.dashboard_id }}/revisions/{{ item.revision_id }}/download"
# dest: "/tmp/dashboards/{{ item.dashboard_id }}.json"
# register: _download_dashboards
# until: _download_dashboards is succeeded
# retries: 5
# delay: 2
# delegate_to: localhost
# run_once: true
# changed_when: false
# with_items: "{{ grafana_dashboards }}"
# when: grafana_dashboards | length > 0
# Use curl to solve issue #77
- name: download grafana dashboard from grafana.net to local directory
become: false
get_url:
url: "https://grafana.com/api/dashboards/{{ item.dashboard_id }}/revisions/{{ item.revision_id }}/download"
dest: "/tmp/dashboards/{{ item.dashboard_id }}.json"
command: "curl --compressed https://grafana.com/api/dashboards/{{ item.dashboard_id }}/revisions/{{ item.revision_id }}/download -o /tmp/dashboards/{{ item.dashboard_id }}.json"
args:
creates: "/tmp/dashboards/{{ item.dashboard_id }}.json"
warn: false
register: _download_dashboards
until: _download_dashboards is succeeded
retries: 5
delay: 2
delegate_to: localhost
run_once: true
changed_when: false
with_items: "{{ grafana_dashboards }}"
when: grafana_dashboards | length > 0
tags:
- skip_ansible_lint
# As noted in [1] an exported dashboard replaces the exporter's datasource
# name with a representative name, something like 'DS_GRAPHITE'. The name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment