Verified Commit 0d36ac64 authored by erdnaxe's avatar erdnaxe 🎇

[monitoring] Use ip filter for adm

parent 43d66a32
Pipeline #3254 passed with stage
in 2 minutes and 59 seconds
---
# Custom header
dirty: "{{lookup('pipe', 'git diff --quiet || echo dirty')}}"
ansible_header: |
+++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -11,3 +12,6 @@ ansible_header: |
{% endif %}
+++++++++++++++++++++++++++++++++++++++++++++++++++
# Crans subnets
adm_subnet: 10.231.136.0/24
......@@ -38,10 +38,14 @@
# Monitor all hosts
- hosts: server,test_vm
vars:
adm_ipv4: "{{ ansible_all_ipv4_addresses | ipaddr(adm_subnet) | first }}"
roles: ["prometheus-node-exporter"]
# Export apache metrics
- hosts: zamok.adm.crans.org
vars:
adm_ipv4: "{{ ansible_all_ipv4_addresses | ipaddr(adm_subnet) | first }}"
roles: ["prometheus-apache-exporter"]
# Configure HP RAID monitoring
......
......@@ -12,5 +12,5 @@
path: /etc/default/prometheus-apache-exporter
regexp: '^ARGS='
line: |
ARGS="-telemetry.address={{ ansible_hostname }}.adm.crans.org:9117"
ARGS="-telemetry.address={{ adm_ipv4 }}:9117"
notify: Restart prometheus-apache-exporter
......@@ -4,7 +4,7 @@
# Due to shell scaping, to pass backslashes for regexes, you need to double
# them (\\d for \d). If running under systemd, you need to double them again
# (\\\\d to mean \d), and escape newlines too.
ARGS="--web.listen-address={{ lookup('dig', ansible_host) }}:9100"
ARGS="--web.listen-address={{ adm_ipv4 }}:9100"
# Prometheus-node-exporter supports the following options:
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment