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

Commit

Permalink
add datasources in yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom committed Dec 23, 2017
1 parent 27e9df7 commit b17b5d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
- "{{ grafana_data_dir }}"
- "{{ grafana_data_dir }}/dashboards"
- "{{ grafana_data_dir }}/plugins"
- "{{ grafana_data_dir }}/provisioning"
- "{{ grafana_data_dir }}/provisioning/datasources"

- name: Enable grafana system service
systemd:
Expand Down
9 changes: 9 additions & 0 deletions tasks/datasources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@
with_items: "{{ grafana_datasources }}"
no_log: True
when: datasources.content == "[]"

- name: Create datasources file
copy:
dest: "{{ grafana_data_dir }}/provisioning/datasources/ansible.yml"
content: |
delete_datasources: []
datasources:
{{ grafana_datasources | to_nice_yaml }}
backup: no

0 comments on commit b17b5d5

Please sign in to comment.