Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sol1-grafana
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sol1 Ansible Roles
sol1-grafana
Commits
fc2c9f06
Unverified
Commit
fc2c9f06
authored
6 years ago
by
Paweł Krupa
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #92 from cloudalchemy/resolve_77
[patch] Use curl instead of get_url to download dashboards
parents
72992820
d99c26a5
Branches
Branches containing commit
Tags
0.11.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/dashboards.yml
+23
-5
23 additions, 5 deletions
tasks/dashboards.yml
with
23 additions
and
5 deletions
tasks/dashboards.yml
+
23
−
5
View file @
fc2c9f06
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment