You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
821 B
YAML
29 lines
821 B
YAML
---
|
|
|
|
- name: Create datasources
|
|
ansible.builtin.template:
|
|
src: "datasources/{{ item.value.type }}.yaml.j2"
|
|
dest: "{{ grafana_server_paths_provisioning }}/datasources/{{ item.key }}.yaml"
|
|
owner: root
|
|
group: grafana
|
|
mode: "0640"
|
|
notify: "Restart Grafana"
|
|
loop: "{{ grafana_server_datasources | dict2items }}"
|
|
when:
|
|
- grafana_server_datasources is defined
|
|
no_log: true
|
|
|
|
- name: Delete datasources
|
|
community.grafana.grafana_datasource:
|
|
grafana_url: "{{ grafana_server_grafana_url }}"
|
|
grafana_user: "{{ grafana_server_admin_user }}"
|
|
grafana_password: "{{ grafana_server_admin_password }}"
|
|
name: "{{ item }}"
|
|
state: absent
|
|
notify: "Restart Grafana"
|
|
loop: "{{ grafana_server_datasources_to_delete }}"
|
|
when:
|
|
- grafana_server_datasources_to_delete is defined
|
|
|
|
...
|