This commit is contained in:
2021-06-08 12:29:56 +02:00
parent ea3195a93c
commit dd1baa4aef
4 changed files with 633 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
- name: create influx token for grafana
influx_token:
base: "http://localhost:{{influx_pubport}}"
org: "my-org"
auth_token: "{{influx_admin_token}}"
description: grafana read access
key: grafana
permissions:
- action: read
resource:
type: buckets
register: influx_grafana_token
- name: run grafana
docker_container:
name: ed-grafana
image: grafana/grafana:7.5.7
hostname: ed-grafana
domainname: cobald.local
networks:
- name: "{{docker_network}}"
published_ports:
- "3000:3000"
state: started
detach: True
cleanup: True
- community.grafana.grafana_datasource:
grafana_url: http://localhost:3000
grafana_user: admin
grafana_password: admin
name: InfluxDB
ds_type: influxdb
ds_url: "{{influx_url}}"
additional_json_data:
defaultBucket: "{{influx_bucket}}"
organization: "{{influx_org}}"
version: Flux
additional_secure_json_data:
token: "{{influx_grafana_token.token}}"
register: das
- community.grafana.grafana_dashboard:
grafana_url: http://localhost:3000
grafana_user: admin
grafana_password: admin
state: present
commit_message: updated by ansible
overwrite: yes
json_data: "{{lookup('file', 'grafana-dash.json')|from_json}}"