Add prometheus deployment
This commit is contained in:
4
deploy_monitoring.yaml
Normal file
4
deploy_monitoring.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: Deploy Gitea
|
||||
hosts: monitoring
|
||||
roles:
|
||||
- prometheus
|
||||
@@ -12,3 +12,6 @@ all_servers:
|
||||
children:
|
||||
minecraft_servers:
|
||||
devops_servers:
|
||||
hosts:
|
||||
monitoring:
|
||||
ansible_host: monitoring.malcolms.xyz
|
||||
|
||||
19
prometheus/tasks/main.yaml
Normal file
19
prometheus/tasks/main.yaml
Normal 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
|
||||
12
prometheus/templates/prometheus.yml.j2
Normal file
12
prometheus/templates/prometheus.yml.j2
Normal 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']
|
||||
Reference in New Issue
Block a user