aboutsummaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-08-26 17:49:22 +0200
committerGravatar Joe Banks <[email protected]>2024-08-26 17:33:31 +0100
commitefb9fa9194ff5f70fe027b945787cbc34293db05 (patch)
treee7534ba9898b5b524199b526068a6a126f967e85 /ansible
parentStop installing libsasl2-modules-ldap (diff)
Install prometheus-postfix-exporter
As a data-obsessed administrator I want to have more data such that I can widen my sense of power. This also installs rsyslog, because prometheus-postfix-exporter doesn't work with journald's binary log format.
Diffstat (limited to 'ansible')
-rw-r--r--ansible/host_vars/lovelace/prometheus.yml7
-rw-r--r--ansible/playbook.yml1
-rw-r--r--ansible/roles/prometheus-postfix-exporter/meta/main.yml3
-rw-r--r--ansible/roles/prometheus-postfix-exporter/tasks/main.yml7
4 files changed, 18 insertions, 0 deletions
diff --git a/ansible/host_vars/lovelace/prometheus.yml b/ansible/host_vars/lovelace/prometheus.yml
index 6dc92e2..68709f0 100644
--- a/ansible/host_vars/lovelace/prometheus.yml
+++ b/ansible/host_vars/lovelace/prometheus.yml
@@ -55,6 +55,13 @@ prometheus_configuration: |
- {{ hostvars[host]['ansible_wg0']['ipv4']['address'] }}:9187
{%- endfor %}
+ - job_name: postfix
+ static_configs:
+ - targets:
+ {%- for host in groups['mail'] %}
+ - {{ hostvars[host]['ansible_wg0']['ipv4']['address'] }}:9154
+ {%- endfor %}
+
- job_name: blackbox-ssh
metrics_path: /probe
params:
diff --git a/ansible/playbook.yml b/ansible/playbook.yml
index 1ac0c05..dd1e18d 100644
--- a/ansible/playbook.yml
+++ b/ansible/playbook.yml
@@ -26,6 +26,7 @@
- dovecot
- spamassassin
- postfix
+ - prometheus-postfix-exporter
- name: Deploy our monitoring stack
hosts: monitoring
diff --git a/ansible/roles/prometheus-postfix-exporter/meta/main.yml b/ansible/roles/prometheus-postfix-exporter/meta/main.yml
new file mode 100644
index 0000000..23db107
--- /dev/null
+++ b/ansible/roles/prometheus-postfix-exporter/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - postfix
diff --git a/ansible/roles/prometheus-postfix-exporter/tasks/main.yml b/ansible/roles/prometheus-postfix-exporter/tasks/main.yml
new file mode 100644
index 0000000..f2ad903
--- /dev/null
+++ b/ansible/roles/prometheus-postfix-exporter/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+- name: Install prometheus-postfix-exporter
+ package:
+ name: prometheus-postfix-exporter
+ state: present
+ tags:
+ - role::prometheus-postfix-exporter