Raspberry-Pi-IaC/roles/monitoring/tasks/main.yml
Thomas Kleinendorst 71499b2610 Bind hostname to 172.0.1.1 and use FQDN in config
This makes that we see better labels in Grafana and that we don't
need to expose the address externally.
2024-09-23 12:23:05 +02:00

52 lines
1.8 KiB
YAML

---
- name: Include the Prometheus role
ansible.builtin.include_role:
name: prometheus.prometheus.prometheus
- name: Include simple-reverse-proxy role - Prometheus
ansible.builtin.include_role:
name: simple-reverse-proxy
vars:
simple_reverse_proxy_internal_port: 9090
simple_reverse_proxy_internal_subdomain: prometheus
- name: Include the Prometheus - node exporter role
ansible.builtin.include_role:
name: prometheus.prometheus.node_exporter
- name: Include the Prometheus - alertmanager role
ansible.builtin.include_role:
name: prometheus.prometheus.alertmanager
- name: Include simple-reverse-proxy role - Prometheus
ansible.builtin.include_role:
name: simple-reverse-proxy
vars:
simple_reverse_proxy_internal_port: 9093
simple_reverse_proxy_internal_subdomain: alertmanager
# region: Install Grafana
- name: Include user role
ansible.builtin.include_role:
name: user
vars:
user_username: "{{ grafana_username }}"
user_password: "{{ grafana_password }}"
- name: Create the grafana container
ansible.builtin.include_role:
name: podman-container
apply:
become: true
become_user: "{{ grafana_username }}"
vars:
podman_container_name: grafana-server
podman_container_image: docker.io/grafana/grafana
podman_container_tag: "{{ grafana_version }}"
podman_container_env:
GF_INSTALL_PLUGINS: "grafana-clock-panel 2.1.7"
podman_container_publish:
- 127.0.0.1:3000:3000
podman_container_volumes:
- name: grafana_storage
mnt: /var/lib/grafana
- name: Include simple-reverse-proxy role - Grafana
ansible.builtin.include_role:
name: simple-reverse-proxy
vars:
simple_reverse_proxy_internal_port: 3000
simple_reverse_proxy_internal_subdomain: grafana