Add Grafana role

This commit is contained in:
uumas
2023-03-21 01:13:09 +02:00
parent 265270eed3
commit d5f2bb84c6
2 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
---
argument_specs:
main:
short_description: Alpine container
description: "Sets up an alpine docker container. This role can be used as a template for other roles using the container role."
options:
databse_passwords:
description: "Passed to container role"
required: true
type: dict
options:
grafana:
description: "Grafana database password"
type: str
required: true
docker_vhost_domains:
description: "Passed to container role"
required: true
type: dict
options:
grafana:
description: "Grafana vhost domain"
type: list
required: true
elements: str
# All options after this will be passed directly to the container role
docker_host_user:
description: "Passed to container role"
required: false
docker_additional_services:
description: "Passed to container role"
required: false
docker_volume_type:
description: "Passed to container role"
required: false
reverse_proxy_type:
description: "Passed to container role"
required: false
ports:
description: "Passed to container role"
required: false
docker_entrypoint:
description: "Passed to container role"
required: false

View File

@@ -0,0 +1,21 @@
---
- name: Grafana container
import_role:
name: container
vars:
docker_service: grafana
docker_image: grafana/grafana
docker_image_http_port: 3000
docker_volumes:
- name: data
path: /var/lib/grafana
docker_database: postgres
docker_env:
GF_DATABASE_TYPE: postgres
GF_DATABASE_HOST: grafana_db:5432
GF_DATABASE_NAME: grafana
GF_DATABASE_USER: grafana
GF_DATABASE_PASSWORD: "{{ database_passwords.grafana }}"
GF_SERVER_DOMAIN: "{{ docker_vhost_domains.grafana[0] }}"
GF_SERVER_ROOT_URL: "https://{{ docker_vhost_domains.grafana[0] }}"