72 lines
1.9 KiB
YAML
72 lines
1.9 KiB
YAML
---
|
|
|
|
- name: Deploy standalone Prometheus on Raspberry Pi 5
|
|
hosts: monitoring_server
|
|
become: true
|
|
|
|
vars:
|
|
# Bind to all interfaces on default port
|
|
prometheus_web_listen_address: "0.0.0.0:9090"
|
|
|
|
# Reduce retention to save storage/microSD wear (default is 15d)
|
|
prometheus_storage_retention: "60d"
|
|
|
|
# Self-scrape configuration
|
|
prometheus_scrape_configs:
|
|
- job_name: "prometheus"
|
|
metrics_path: "/metrics"
|
|
static_configs:
|
|
- targets:
|
|
- "localhost:9090"
|
|
- job_name: "node_exporter"
|
|
metrics_path: "/metrics"
|
|
static_configs:
|
|
- targets:
|
|
- "localhost:9100"
|
|
- "10.7.10.96:9100"
|
|
- "10.7.10.97:9100"
|
|
|
|
roles:
|
|
- role: prometheus.prometheus.prometheus
|
|
|
|
- name: Deploy Grafana on Raspberry Pi 5
|
|
hosts: monitoring_server
|
|
become: true
|
|
|
|
pre_tasks:
|
|
- name: Ensure python3-debian is present for deb822 repository support
|
|
ansible.builtin.apt:
|
|
name: python3-debian
|
|
state: present
|
|
update_cache: true
|
|
|
|
roles:
|
|
- role: grafana.grafana.grafana
|
|
vars:
|
|
grafana_version: "latest"
|
|
|
|
# All grafana.ini sections now live under grafana_ini
|
|
grafana_ini:
|
|
server:
|
|
http_port: 3000
|
|
http_addr: "0.0.0.0"
|
|
security:
|
|
admin_user: "admin"
|
|
admin_password: "LimpBizkit6"
|
|
analytics:
|
|
reporting_enabled: false
|
|
check_for_updates: false
|
|
|
|
# Provision datasources directly
|
|
grafana_datasources:
|
|
- name: "Prometheus"
|
|
type: "prometheus"
|
|
access: "proxy"
|
|
url: "http://localhost:9090"
|
|
isDefault: true
|
|
editable: true
|
|
|
|
# Optional: install community plugins automatically
|
|
# grafana_plugins:
|
|
# - grafana-piechart-panel
|