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

Commit

Permalink
Merge pull request #21 from cloudalchemy/issue9
Browse files Browse the repository at this point in the history
add datasources in yaml file
  • Loading branch information
paulfantom authored Jan 1, 2018
2 parents f241aab + b17b5d5 commit ee18a8e
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 ee18a8e

Please sign in to comment.