Commit 13f79ed4 authored by Nick Busey's avatar Nick Busey

#17 Configuring Grafana automatically

parent e63937f4
Pipeline #36809183 passed with stage
in 29 seconds
......@@ -4,6 +4,7 @@
* Added The Lounge - IRC Bouncer
* Added Radarr - DVR
* Added Sonarr - DVR
* Automated Grafana Configuration
# 0.3
......
......@@ -2,7 +2,13 @@
[Grafana](https://grafana.com/) is a Time Series Database graphing application.
You can use it to visualize the Weather data imported by [influxdb_darksky](software/influxdb_darksky)
You can use it to visualize the Weather data imported by [influxdb_darksky](software/influxdb_darksky),
power, activity, and other data from [Home Assistant](software/homeassistant.md), and general server
information via Telegraf.
Grafana comes configured with a Dashboard for you out of the box.
You can login with the default user and pass you setup for HomelabOS.
## Access
......
......@@ -7,6 +7,7 @@
- name: Upgrade all dist packages
apt: upgrade=dist
ignore_errors: True
tags:
- dependencies
......
......@@ -3,13 +3,16 @@
file:
path: "{{ item }}"
state: directory
mode: '1777'
loop:
- /var/homelabos/apple_health_influx
- /var/homelabos/dasher
- /var/homelabos/docker
- /var/homelabos/mastodon/public/assets
- /var/homelabos/telegraf
- /var/homelabos/traefik
- /var/homelabos/grafana/data
- /var/homelabos/grafana/datasources
- /var/homelabos/grafana/dashboards
- /mnt/nas
ignore_errors: "yes"
......@@ -42,6 +45,17 @@
path: /etc/fstab
line: '{{ nas_path }} /mnt/nas cifs username={{ nas_user }},vers=2.0,dom={{ nas_workgroup }},password={{ nas_pass }},uid=1000,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0'
- name: Configure Grafana Datasources
template: src={{ item }} dest=/var/homelabos/grafana/datasources/{{ item }}
loop:
- grafana.datasource.influxdb.yaml
- name: Configure Grafana Dashboards
template: src={{ item }} dest=/var/homelabos/grafana/dashboards/{{ item }}
loop:
- grafana.dashboards.yaml
- grafana.dash.homelab.json
- name: Mount NAS Drives
command: mount -a
args:
......
......@@ -167,7 +167,9 @@ services:
links:
- influxdb
volumes:
- /var/homelabos/grafana:/var/lib/grafana
- /var/homelabos/grafana/data/:/var/lib/grafana/
- /var/homelabos/grafana/dashboards/:/etc/grafana/provisioning/dashboards/
- /var/homelabos/grafana/datasources/:/etc/grafana/provisioning/datasources/
environment:
- GF_INSTALL_PLUGINS=grafana-clock-panel,natel-discrete-panel,petrslavotinek-carpetplot-panel,vonage-status-panel,raintank-worldping-app
- GF_SMTP_ENABLED=true
......@@ -176,6 +178,8 @@ services:
- GF_SMTP_PASSWORD={{ smtp_pass }}
- GF_SMTP_FROM_ADDRESS={{ smtp_from_email }}
- GF_SMTP_FROM_NAME={{ smtp_from_name }}
- GF_SECURITY_ADMIN_USER={{ default_username }}
- GF_SECURITY_ADMIN_PASSWORD={{ default_password }}
labels:
- "traefik.enable=true"
- "traefik.http.frontend.rule=Host:grafana.{{ domain }}"
......@@ -255,15 +259,8 @@ services:
- /etc/localtime:/etc/localtime:ro
environment:
- TZ={{ timezone }}
labels:
- "traefik.enable=true"
- "traefik.http.frontend.rule=Host:jackett.{{ domain }}"
- "traefik.http.protocol={{ protocol }}"
- "traefik.http.port=9117"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM https://{{ domain }}"
- "traefik.tor.frontend.rule=Host:jackett.{{ tor_domain }}"
- "traefik.tor.protocol={{ protocol }}"
- "traefik.tor.port=9117"
ports:
- 9117:9117
# kibitzr:
# image: peterdemin/kibitzr
......@@ -485,8 +482,6 @@ services:
organizr:
image: organizrtools/organizr-v2
restart: always
ports:
- 8083:80
volumes:
- /var/homelabos/organizr:/config
labels:
......@@ -632,6 +627,28 @@ services:
- "traefik.tor.protocol={{ protocol }}"
- "traefik.tor.port=9000"
# TV Downloader
sonarr:
image: linuxserver/sonarr
restart: always
environment:
- PGID=1000
- PUID=1000
- TZ={{ timezone }}
links:
- jackett
- transmission
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/homelabos/sonarr/config:/config
- /mnt/nas/TV:/tv
- /var/homelabos/sonarr/downloads:/downloads
labels:
- "traefik.enable=true"
- "traefik.http.frontend.rule=Host:sonarr.{{ domain }}"
- "traefik.http.protocol={{ protocol }}"
- "traefik.http.port=8989"
# Movie Downloader
radarr:
image: linuxserver/radarr
......@@ -653,9 +670,6 @@ services:
- "traefik.http.frontend.rule=Host:radarr.{{ domain }}"
- "traefik.http.protocol={{ protocol }}"
- "traefik.http.port=7878"
- "traefik.tor.frontend.rule=Host:radarr.{{ tor_domain }}"
- "traefik.tor.protocol={{ protocol }}"
- "traefik.tor.port=7878"
# Backups https://nickbusey.gitlab.io/HomelabOS/software/restic/
restic:
......@@ -676,31 +690,6 @@ services:
- /etc/localtime:/etc/localtime:ro
- /var/homelabos:/data:ro
# TV Downloader
sonarr:
image: linuxserver/sonarr
restart: always
environment:
- PGID=1000
- PUID=1000
- TZ={{ timezone }}
links:
- jackett
- transmission
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/homelabos/sonarr/config:/config
- /mnt/nas/TV:/tv
- /var/homelabos/sonarr/downloads:/downloads
labels:
- "traefik.enable=true"
- "traefik.http.frontend.rule=Host:sonarr.{{ domain }}"
- "traefik.http.protocol={{ protocol }}"
- "traefik.http.port=8989"
- "traefik.tor.frontend.rule=Host:sonarr.{{ tor_domain }}"
- "traefik.tor.protocol={{ protocol }}"
- "traefik.tor.port=8989"
# Sync Server
syncthing:
image: linuxserver/syncthing
......
This diff is collapsed.
apiVersion: 1
providers:
- name: 'Influxdb'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /etc/grafana/provisioning/dashboards
\ No newline at end of file
# config file version
apiVersion: 1
# list of datasources to insert/update depending
# what's available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Influxdb
# <string, required> datasource type. Required
type: influxdb
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://influxdb:8086
password:
user:
database: telegraf
version: 1
......@@ -218,15 +218,39 @@
<li class="md-nav__item">
<a href="/setup/installation/" title="Installation" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="/setup/gettingstarted/" title="Getting Started" class="md-nav__link">
Getting Started
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
<label class="md-nav__link" for="nav-2">
<label class="md-nav__link" for="nav-4">
Setup
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-2">
<label class="md-nav__title" for="nav-4">
Setup
</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -238,20 +262,8 @@
<li class="md-nav__item">
<a href="/setup/installation/" title="Installation" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="/setup/gettingstarted/" title="Getting Started" class="md-nav__link">
Getting Started
<a href="/setup/backups/" title="Backups" class="md-nav__link">
Backups
</a>
</li>
......@@ -262,8 +274,8 @@
<li class="md-nav__item">
<a href="/setup/backups/" title="Backups" class="md-nav__link">
Backups
<a href="/setup/smtp/" title="SMTP" class="md-nav__link">
SMTP
</a>
</li>
......@@ -304,13 +316,13 @@
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
<label class="md-nav__link" for="nav-3">
<label class="md-nav__link" for="nav-5">
Included Software
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-3">
<label class="md-nav__title" for="nav-5">
Included Software
</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -453,6 +465,18 @@
<li class="md-nav__item">
<a href="/software/jackett/" title="Jackett" class="md-nav__link">
Jackett
</a>
</li>
<li class="md-nav__item">
<a href="/software/koel/" title="Koel" class="md-nav__link">
Koel
......@@ -478,8 +502,8 @@
<li class="md-nav__item">
<a href="/software/minio/" title="Minio" class="md-nav__link">
Minio
<a href="/software/miniflux/" title="Miniflux" class="md-nav__link">
Miniflux
</a>
</li>
......@@ -490,8 +514,8 @@
<li class="md-nav__item">
<a href="/software/miniflux/" title="Miniflux" class="md-nav__link">
Miniflux
<a href="/software/minio/" title="Minio" class="md-nav__link">
Minio
</a>
</li>
......@@ -562,8 +586,32 @@
<li class="md-nav__item">
<a href="/software/terminal/" title="Terminal" class="md-nav__link">
Terminal
<a href="/software/radarr-sonarr/" title="Radarr / Sonarr" class="md-nav__link">
Radarr / Sonarr
</a>
</li>
<li class="md-nav__item">
<a href="/software/syncthing/" title="Synchthing" class="md-nav__link">
Synchthing
</a>
</li>
<li class="md-nav__item">
<a href="/software/thelounge/" title="The Lounge" class="md-nav__link">
The Lounge
</a>
</li>
......
......@@ -258,15 +258,39 @@
<li class="md-nav__item">
<a href="setup/installation/" title="Installation" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="setup/gettingstarted/" title="Getting Started" class="md-nav__link">
Getting Started
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
<label class="md-nav__link" for="nav-2">
<label class="md-nav__link" for="nav-4">
Setup
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-2">
<label class="md-nav__title" for="nav-4">
Setup
</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -278,20 +302,8 @@
<li class="md-nav__item">
<a href="setup/installation/" title="Installation" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="setup/gettingstarted/" title="Getting Started" class="md-nav__link">
Getting Started
<a href="setup/backups/" title="Backups" class="md-nav__link">
Backups
</a>
</li>
......@@ -302,8 +314,8 @@
<li class="md-nav__item">
<a href="setup/backups/" title="Backups" class="md-nav__link">
Backups
<a href="setup/smtp/" title="SMTP" class="md-nav__link">
SMTP
</a>
</li>
......@@ -344,13 +356,13 @@
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
<label class="md-nav__link" for="nav-3">
<label class="md-nav__link" for="nav-5">
Included Software
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-3">
<label class="md-nav__title" for="nav-5">
Included Software
</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -493,6 +505,18 @@
<li class="md-nav__item">
<a href="software/jackett/" title="Jackett" class="md-nav__link">
Jackett
</a>
</li>
<li class="md-nav__item">
<a href="software/koel/" title="Koel" class="md-nav__link">
Koel
......@@ -518,8 +542,8 @@
<li class="md-nav__item">
<a href="software/minio/" title="Minio" class="md-nav__link">
Minio
<a href="software/miniflux/" title="Miniflux" class="md-nav__link">
Miniflux
</a>
</li>
......@@ -530,8 +554,8 @@
<li class="md-nav__item">
<a href="software/miniflux/" title="Miniflux" class="md-nav__link">
Miniflux
<a href="software/minio/" title="Minio" class="md-nav__link">
Minio
</a>
</li>
......@@ -602,8 +626,32 @@
<li class="md-nav__item">
<a href="software/terminal/" title="Terminal" class="md-nav__link">
Terminal
<a href="software/radarr-sonarr/" title="Radarr / Sonarr" class="md-nav__link">
Radarr / Sonarr
</a>
</li>
<li class="md-nav__item">
<a href="software/syncthing/" title="Synchthing" class="md-nav__link">
Synchthing
</a>
</li>
<li class="md-nav__item">
<a href="software/thelounge/" title="The Lounge" class="md-nav__link">
The Lounge
</a>
</li>
......
This diff is collapsed.
......@@ -221,27 +221,6 @@
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" checked>
<label class="md-nav__link" for="nav-2">
Setup
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-2">
Setup
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../installation/" title="Installation" class="md-nav__link">
......@@ -249,10 +228,10 @@
</a>
</li>
<li class="md-nav__item">
......@@ -261,6 +240,27 @@
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" checked>
<label class="md-nav__link" for="nav-4">
Setup
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-4">
Setup
</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -336,6 +336,18 @@
<li class="md-nav__item">
<a href="../smtp/" title="SMTP" class="md-nav__link">
SMTP
</a>
</li>
<li class="md-nav__item">
<a href="../tor/" title="Tor Onion Services" class="md-nav__link">
Tor Onion Services
......@@ -367,13 +379,13 @@
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
<label class="md-nav__link" for="nav-3">
<label class="md-nav__link" for="nav-5">
Included Software
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-3">
<label class="md-nav__title" for="nav-5">
Included Software
</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -516,6 +528,18 @@
<li class="md-nav__item">
<a href="../../software/jackett/" title="Jackett" class="md-nav__link">
Jackett
</a>
</li>
<li class="md-nav__item">
<a href="../../software/koel/" title="Koel" class="md-nav__link">
Koel
......@@ -541,8 +565,8 @@
<li class="md-nav__item">
<a href="../../software/minio/" title="Minio" class="md-nav__link">
Minio
<a href="../../software/miniflux/" title="Miniflux" class="md-nav__link">
Miniflux
</a>
</li>
......@@ -553,8 +577,8 @@
<li class="md-nav__item">
<a href="../../software/miniflux/" title="Miniflux" class="md-nav__link">
Miniflux
<a href="../../software/minio/" title="Minio" class="md-nav__link">
Minio
</a>
</li>
......@@ -625,8 +649,32 @@
<li class="md-nav__item">
<a href="../../software/terminal/" title="Terminal" class="md-nav__link">
Terminal
<a href="../../software/radarr-sonarr/" title="Radarr / Sonarr" class="md-nav__link">
Radarr / Sonarr
</a>
</li>
<li class="md-nav__item">
<a href="../../software/syncthing/" title="Synchthing" class="md-nav__link">
Synchthing
</a>
</li>
<li class="md-nav__item">
<a href="../../software/thelounge/" title="The Lounge" class="md-nav__link">
The Lounge
</a>
</li>
......@@ -762,13 +810,13 @@
</a>
<a href="../tor/" title="Tor Onion Services" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../smtp/" title="SMTP" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Next
</span>