homelab/roles/monitoring/tasks/grafana.yml

29 lines
748 B
YAML
Raw Normal View History

2024-10-15 21:56:15 +05:00
---
- name: Create monitoring docker network
become: true
community.docker.docker_network:
name: monitoring
- name: Create grafana volume
become: true
community.docker.docker_volume:
name: grafana
- name: Run grafana
become: true
community.docker.docker_container:
name: grafana
image: grafana/grafana:11.2.2
volumes:
- grafana:/var/lib/grafana
networks:
- name: postgresql
- name: monitoring
- name: haproxy
env:
GF_DATABASE_TYPE: postgres
GF_DATABASE_HOST: postgresql:5432
GF_DATABASE_NAME: grafana
GF_DATABASE_USER: grafana
GF_DATABASE_PASSWORD: "{{ grafana_database_password }}"
GF_DATABASE_SSL_MODE: disable
restart_policy: unless-stopped