Add Grafana

This commit is contained in:
2026-01-02 19:06:29 -05:00
parent 1ea3ed93bb
commit 745bd69d50
2 changed files with 22 additions and 0 deletions

View File

@@ -2,3 +2,4 @@
hosts: monitoring hosts: monitoring
roles: roles:
- prometheus - prometheus
- grafana

21
grafana/tasks/main.yaml Normal file
View File

@@ -0,0 +1,21 @@
- name: Download Grafana GPG keys
become: true
ansible.builtin.get_url:
url: https://apt.grafana.com/gpg.key
dest: /etc/apt/keyrings/grafana.gpg
- name: Add Grafana repository
become: true
ansible.builtin.apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main"
state: present
- name: Install Grafana
become: true
ansible.builtin.apt:
name: grafana
state: latest
- name: Start Grafana
become: true
ansible.builtin.systemd_service:
name: grafana
state: restarted
enabled: true