ansible-role-grafana/README.md

79 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2022-12-19 14:18:31 +01:00
# laurivan.grafana
This role installs Grafana via Docker.
## Requirements
None
## Role Variables
All variables are listed below (see also `defaults/main.yml`).
2022-12-19 15:02:42 +01:00
### Paths and Volumes
2022-12-19 14:18:31 +01:00
2022-12-19 15:02:42 +01:00
All paths are by default defined as relative to `grafana_volume_base`:
2022-12-19 14:18:31 +01:00
```yml
2022-12-19 15:02:42 +01:00
grafana_volume_base: "/mnt/data/grafana"
grafana_setup_path: "{{ grafana_volume_base }}/config"
grafana_volume_grafana: "{{ grafana_volume_base }}/grafana"
grafana_volume_influxdb: "{{ grafana_volume_base }}/influxdb"
2022-12-19 14:18:31 +01:00
```
2022-12-19 15:02:42 +01:00
You can however define specific volumes for the individual items:
2022-12-19 14:18:31 +01:00
2022-12-19 15:02:42 +01:00
- `grafana_setup_path` - where the Docker compose files are placed
- `grafana_volume_grafana` - volume for the grafana docker container
- `grafana_volume_influxdb` - volume for InfluxDB
2022-12-19 14:18:31 +01:00
2022-12-19 15:02:42 +01:00
### InfluxDB
2022-12-19 14:18:31 +01:00
2022-12-19 15:02:42 +01:00
We define the following variables for InfluxDB:
2022-12-19 14:18:31 +01:00
```yml
2022-12-19 15:02:42 +01:00
influxdb:
username: influxdb
password: change_me
org: example.com
bucket: my_bucket
admin_token: change_me
2022-12-19 14:18:31 +01:00
```
2022-12-19 15:02:42 +01:00
### Grafana
2022-12-19 14:18:31 +01:00
2022-12-19 15:02:42 +01:00
We also define several variables for grafana
2022-12-19 14:18:31 +01:00
```yml
2022-12-19 15:02:42 +01:00
grafana:
username: changeme
password: changeme
2022-12-19 14:18:31 +01:00
```
2022-12-19 15:02:42 +01:00
Just in case, you can override the user/group for grafana via:
2022-12-19 14:18:31 +01:00
```yml
2022-12-19 15:02:42 +01:00
grafana_uid:
grafana_gid:
2022-12-19 14:18:31 +01:00
```
## Dependencies
You need a machine with docker and docker-compose installed.
## Example Playbook
```yml
- hosts: servers
roles:
- 'laurivan.grafana'
```
## License
MIT
## Author Information
This role was created in 2022 by [Laur Ivan](https://www.laurivan.com).