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.
37 lines
1.4 KiB
YAML
37 lines
1.4 KiB
YAML
---
|
|
|
|
- name: Set fact for Grafana URL when using HTTP
|
|
ansible.builtin.set_fact:
|
|
grafana_server_grafana_url: "http://localhost:{{ grafana_server_http_port }}"
|
|
when:
|
|
- not grafana_server_enable_https | bool
|
|
- grafana_server_grafana_url is undefined
|
|
|
|
- name: Set fact for Grafana URL when using HTTPS
|
|
ansible.builtin.set_fact:
|
|
grafana_server_grafana_url: "https://localhost:{{ grafana_server_http_port }}"
|
|
when:
|
|
- grafana_server_enable_https | bool
|
|
- grafana_server_grafana_url is undefined
|
|
|
|
- name: Create datasources
|
|
community.grafana.grafana_datasource:
|
|
grafana_url: "{{ grafana_server_grafana_url }}"
|
|
grafana_user: "{{ grafana_server_admin_user }}"
|
|
grafana_password: "{{ grafana_server_admin_password }}"
|
|
org_id: 1
|
|
name: "{{ item.key }}"
|
|
ds_type: "{{ item.value.type }}"
|
|
ds_url: "{{ item.value.url }}"
|
|
database: "{{ item.value.database | default(omit) }}"
|
|
user: "{{ item.value.user | default(omit) }}"
|
|
sslmode: "{{ item.value.sslmode | default(omit) }}"
|
|
additional_json_data: "{{ item.value.additonal_json_data | default(omit) }}"
|
|
additional_secure_json_data: "{{ item.value.additional_secure_json_data | default(omit) }}"
|
|
enforce_secure_data: "{{ item.value.enforce_secure_data | default(false) }}"
|
|
loop: "{{ grafana_server_datasources | dict2items }}"
|
|
when:
|
|
- grafana_server_datasources is defined
|
|
|
|
...
|