- 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 - wait_for: host: localhost port: 3000 - 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-dashboard.json')|from_json}}"