add tls support to datasources

This commit is contained in:
nd 2020-05-23 14:44:31 +02:00
parent dbb533424f
commit 5366264f44
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
3 changed files with 63 additions and 10 deletions

View file

@ -51,22 +51,30 @@
method: GET
status_code: 200
- name: convert tls paths to data (datasources)
include_tasks: tls-path-to-data.yml
vars:
grafanakey: datasources
loop: "{{ grafana.datasources|dict2items }}"
- name: create data sources
loop: "{{ grafana.datasources }}"
loop: "{{ grafana.datasources|dict2items }}"
grafana_datasource:
name: "{{ item.name }}"
name: "{{ item.key }}"
grafana_url: "http://127.0.0.1"
grafana_user: "admin"
grafana_password: "{{ grafana.adminpw }}"
ds_type: "{{ item.ds_type }}"
url: "{{ item.url }}"
is_default: "{{ item.is_default }}"
ds_type: "{{ item.value.ds_type }}"
url: "{{ item.value.url }}"
is_default: "{{ item.value.is_default }}"
tls_ca_cert: "{{ item.value.tls_ca_cert|d(omit) }}"
tls_client_cert: "{{ item.value.tls_client_cert|d(omit) }}"
tls_client_key: "{{ item.value.tls_client_key|d(omit) }}"
- name: import dashboards
loop: "{{ grafana.dashboards }}"
loop: "{{ grafana.dashboards||dict2items }}"
grafana_dashboard:
grafana_url: "http://127.0.0.1"
grafana_user: "admin"
grafana_password: "{{ grafana.adminpw }}"
path: "{{ item.path }}"
path: "{{ item.value.path }}"