Add prometheus deployment

This commit is contained in:
2026-01-02 17:27:22 -05:00
parent ce31fc354a
commit 5926b84d49
4 changed files with 38 additions and 0 deletions

4
deploy_monitoring.yaml Normal file
View File

@@ -0,0 +1,4 @@
- name: Deploy Gitea
hosts: monitoring
roles:
- prometheus

View File

@@ -12,3 +12,6 @@ all_servers:
children:
minecraft_servers:
devops_servers:
hosts:
monitoring:
ansible_host: monitoring.malcolms.xyz

View File

@@ -0,0 +1,19 @@
- name: Install Prometheus
become: true
become_user: root
ansible.builtin.apt:
name: prometheus
state: latest
- name: Install config
become: true
become_user: root
ansible.builtin.template:
src: prometheus.yml.j2
dest: "/etc/prometheus/prometheus.yml"
- name: Start service
become: true
become_user: root
ansible.builtin.systemd_service:
name: prometheus
enabled: true
state: restarted

View File

@@ -0,0 +1,12 @@
global:
scrape_interval: 15s
evaluation_interval: 15s
rule_files:
# - "first.rules"
# - "second.rules"
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']