Skip to content
This repository was archived by the owner on May 31, 2023. It is now read-only.

Commit 9ef9e56

Browse files
tillpaulfantom
authored andcommitted
Fix: make curl fail when we encounter a 404 (#107)
- this happens when you supply a dashboard ID (or revision) which does not exist - currently, the error (json) is downloaded and then uploaded to grafana (which fails) - this patch/fix should uncover that problem more easily
1 parent 7cfa8de commit 9ef9e56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/dashboards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Use curl to solve issue #77
2727
- name: download grafana dashboard from grafana.net to local directory
2828
become: false
29-
command: "curl --compressed https://grafana.com/api/dashboards/{{ item.dashboard_id }}/revisions/{{ item.revision_id }}/download -o /tmp/dashboards/{{ item.dashboard_id }}.json"
29+
command: "curl --fail --compressed https://grafana.com/api/dashboards/{{ item.dashboard_id }}/revisions/{{ item.revision_id }}/download -o /tmp/dashboards/{{ item.dashboard_id }}.json"
3030
args:
3131
creates: "/tmp/dashboards/{{ item.dashboard_id }}.json"
3232
warn: false

0 commit comments

Comments
 (0)