Skip to content
Snippets Groups Projects
Commit f5bb0ecf authored by jabertwo's avatar jabertwo
Browse files

grafanaaaaaa test service

parent 69e86b10
No related branches found
No related tags found
No related merge requests found
...@@ -2,50 +2,31 @@ ...@@ -2,50 +2,31 @@
- include_tasks: ../functions/get_secret.yml - include_tasks: ../functions/get_secret.yml
with_items: with_items:
- { path: "{{ basedir }}/grafana_admin_pass", length: 12 } - { path: "{{ basedir }}/secrets/grafana_admin_pass", length: 12 }
- { path: "/srv/mqtt/influxdb_token", length: -1 } # - { path: "/srv/mqtt/influxdb_token", length: -1 }
- name: create folder struct for grafana - name: create folder struct for grafana
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: "directory" state: "directory"
with_items: with_items:
- "{{ basedir }}" - "{{ basedir }}"
- "{{ basedir }}/data/" - "{{ basedir }}/secrets/"
- "{{ basedir }}/provisioning/"
- "{{ basedir }}/provisioning/dashboards/"
- "{{ basedir }}/provisioning/dashboards/pixelflut/"
- "{{ basedir }}/provisioning/datasources/"
- name: create config filess - name: create folder data/ with permissions 777
template: ansible.builtin.file:
path: "{{ basedir }}/data/"
state: directory
mode: '777'
- name: create config files
ansible.builtin.template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}" dest: "{{ basedir }}/{{ item }}"
with_items: with_items:
- docker-compose.yml - docker-compose.yml
- grafana.ini - grafana.ini
- name: create dashboards
template:
src: "provisioning/dashboards/{{ item }}"
dest: "{{ basedir }}/provisioning/dashboards/{{ item }}"
with_items:
- dashboards.yml
- name: create dashboards for pixelflut
template:
src: "provisioning/dashboards/pixelflut/{{ item }}"
dest: "{{ basedir }}/provisioning/dashboards/pixelflut/{{ item }}"
with_items:
- breakwater.json
- name: create datasources
template:
src: "provisioning/datasources/{{ item }}"
dest: "{{ basedir }}/provisioning/datasources/{{ item }}"
with_items:
- datasources.yml
- name: start grafana docker - name: start grafana docker
community.docker.docker_compose_v2: community.docker.docker_compose_v2:
project_src: "{{ basedir }}" project_src: "{{ basedir }}"
......
...@@ -6,7 +6,6 @@ services: ...@@ -6,7 +6,6 @@ services:
restart: always restart: always
volumes: volumes:
- "{{ basedir }}/grafana.ini:/etc/grafana/grafana.ini" - "{{ basedir }}/grafana.ini:/etc/grafana/grafana.ini"
- "{{ basedir }}/provisioning/:/etc/grafana/provisioning/"
- "{{ basedir }}/data/:/var/lib/grafana" - "{{ basedir }}/data/:/var/lib/grafana"
environment: environment:
GF_SERVER_ROOT_URL: "https://{{ domain }}" GF_SERVER_ROOT_URL: "https://{{ domain }}"
......
...@@ -122,7 +122,7 @@ default_theme = dark ...@@ -122,7 +122,7 @@ default_theme = dark
disable_login_form = false disable_login_form = false
# Auto Login via OAuth # Auto Login via OAuth
# oauth_auto_login = true oauth_auto_login = true
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false # Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false ;disable_signout_menu = false
......
apiVersion: 1
providers:
# <string> an unique provider name
- name: 'Pixelflut'
# <int> org id. will default to orgId 1 if not specified
# orgId: 1
# <string, required> name of the dashboard folder. Required
folder: 'Pixelflut'
# <string> folder UID. will be automatically generated if not specified
# folderUid: ''
# <string, required> provider type. Required
type: file
# <bool> disable dashboard deletion
# disableDeletion: false
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: true
options:
# <string, required> path to dashboard files on disk. Required
path: /etc/grafana/provisioning/dashboards/pixelflut
apiVersion: 1
datasources:
- name: MQTT_Flux
type: influxdb
access: proxy
url: http://{{ int_ip4 }}:{{ mqtt_influxdb_port }}
jsonData:
version: Flux
organization: mqtt
defaultBucket: mqtt
tlsSkipVerify: true
secureJsonData:
token: {{ influxdb_token }}
- name: MQTT_InfluxQL
type: influxdb
access: proxy
url: http://{{ int_ip4 }}:{{ mqtt_influxdb_port }}
# This database should be mapped to a bucket
database: mqtt
jsonData:
httpMode: GET
httpHeaderName1: 'Authorization'
secureJsonData:
httpHeaderValue1: 'Token {{ influxdb_token }}'
{% if inventory_hostname == 'hix' %}
- name: Prometheus
type: prometheus
access: proxy
url: http://{{ int_ip4 }}:9090
{% endif %}
{% if inventory_hostname == 'ogg' %}
- name: Pixelflut
type: prometheus
access: proxy
url: http://pixelflut.warpzone.lan:9090
uuid: P0FAC05DE14135586
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment