Browse Source

icinga: define icinga_client_address

so it can be overriden

Fixes: main/infrastructure#192
keep-around/ae543bd8a0c700cf180555f24274463046aa78ac
Loïc Dachary 7 months ago
committed by some
parent
commit
c329e08ffe
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 3
      docs/services/monitoring.rst
  2. 8
      playbooks/icinga/roles/icinga2_client/defaults/main.yml
  3. 2
      playbooks/icinga/roles/icinga2_client/templates/host.conf
  4. 2
      playbooks/icinga/roles/icinga2_client/templates/zones.conf.master

3
docs/services/monitoring.rst

@ -23,3 +23,6 @@ with variables documented in `this file
Problems found by Icinga will be notified via email to the address defined in
`~/.enough/example.com/inventory/host_vars/icinga-host/mail.yml` with
a variable doumented in `this file <https://lab.enough.community/main/infrastructure/blob/master/inventory/group_vars/all/monitoring.yml>`__.
The Icinga master pings the icinga client using `icinga_client_address` as found in
`this file <https://lab.enough.community/main/infrastructure/-/tree/master/playbooks/icinga/roles/icinga2_client/defaults/main.yml>`__.

8
playbooks/icinga/roles/icinga2_client/defaults/main.yml

@ -0,0 +1,8 @@
---
#
#############################################
#
# IP address the icinga master uses to ping
# the icinga client
#
icinga_client_address: "{{ hostvars[inventory_hostname]['ansible_host'] }}"

2
playbooks/icinga/roles/icinga2_client/templates/host.conf

@ -1,6 +1,6 @@
object Host "{{ inventory_hostname }}" {
vars.service_template = "generic-service"
address = "{{ hostvars[inventory_hostname]['ansible_host'] }}"
address = "{{ icinga_client_address }}"
check_command = "hostalive"
{% if monitoring_host_vars is defined %}

2
playbooks/icinga/roles/icinga2_client/templates/zones.conf.master

@ -6,5 +6,5 @@ object Zone "{{ inventory_hostname }}" {
}
object Endpoint "{{ inventory_hostname }}" {
host = "{{ hostvars[inventory_hostname]['ansible_host'] }}"
host = "{{ icinga_client_address }}"
}
Loading…
Cancel
Save