Commit 1759a9d4 authored by Bernhard Geier's avatar Bernhard Geier
Browse files

- AnonIP: Branch von master zu main geändert

- Konfigurationsvariablen für XMPP- und Mail-Notifications geändert
parent 9a2f047f
Subproject commit 67082b407f3818ba48f63d4d8d09e2a5d440e08c
Subproject commit 31b05ffd10bb22b1445d464f330ec77d36be820c
......@@ -5,7 +5,7 @@ admin:
# Konfiguration SMTP-Server
mail:
#force_hostname: "monitoring.example.com" # Absender-Hostname (default: hostname -f)
senderemail: "monitoring@example.com" # Absender-E-Mailadresse
#senderemail: "monitoring@example.com" # Die selbe Absender-E-Mailadresse für alle E-Mails erzwingen
smtp: "smtp.example.com" # SMTP-Server
user: "blabla" # SMTP-Benutzername
pw: "P@55W0rD" # SMTP-Passwort
......@@ -15,24 +15,29 @@ mail:
icinga2:
userliste:
# User, die Zugriff auf IcingaWeb2 und Icinga2-API erhalten sollen
# Wenn "user" und "pw" existieren: Zugriff auf API und IcingaWeb2
# Wenn "email" existiert: E-Mail bei Alerts
# Wenn "jid" existiert: XMPP-Nachricht bei Alerts
# - Wenn "user" und "pw" existieren: Zugriff auf API und IcingaWeb2
# - Wenn "email" existiert: E-Mail bei Alerts
# - Wenn "jid" existiert: XMPP-Nachricht bei Alerts
# (Beliebige Kombination möglich)
- user: admin
pw: Admin1234
- user: weranders
email: ich@example.com
jid: ich@xmpp-example.com
# XMPP-Account von Icinga2
xmpp:
jid: monitoring-bot@example.com
pw: HAikd(sjslkls
nick: "Example Monitoring Bot"
# Notification-Intervalle für E-Mail und XMPP (0: keine Wiederholungen)
mail_interval: 6h
xmpp_interval: 24h
notifications:
mail:
sender: monitoring@example.com
# bei länger bestehenden Problemen alle <Zeiteinheit> eine E-Mail verschicken (0: keine Wiederholungen)
interval: 6h
xmpp:
# XMPP-Account von Icinga2
jid: monitoring-bot@example.com
pw: HAikd(sjslkls
nick: "Example Monitoring Bot"
# bei länger bestehenden Problemen alle <Zeiteinheit> eine XMPP-Nachricht verschicken (0: keine Wiederholungen)
interval: 24h
# Zusätzliche IcingaWeb2-Module
modules:
......@@ -42,7 +47,7 @@ icinga2:
# Icinga2-Dashing
dashing:
release_tag: "3.1.0" # siehe https://hub.docker.com/r/dbodky/dashing-icinga2/tags (default: "latest")
release_tag: "3.2.0" # siehe https://hub.docker.com/r/dbodky/dashing-icinga2/tags (default: "latest")
topbar:
title: "Monitoring example.com"
links:
......
......@@ -6,6 +6,7 @@
- name: Clone github repo for AnonIP
git:
repo: "https://github.com/DigitaleGesellschaft/Anonip.git"
version: "main"
dest: "/usr/local/Anonip.git"
clone: yes
update: yes
......
- name: update-exim4.conf
command: update-exim4.conf
- name: restart exim4
service:
name: exim4
state: restarted
- name: update-exim4.conf
command: update-exim4.conf
......@@ -11,10 +11,17 @@
- 'role::icinga2-graphite'
- import_tasks: icinga2-3rdparty-notifications-xmpp.yml
when: icinga2.xmpp.jid is defined and icinga2.xmpp.jid and icinga2.xmpp.pw is defined and icinga2.xmpp.pw
when: icinga2.notifications.xmpp.jid is defined and icinga2.notifications.xmpp.jid and icinga2.notifications.xmpp.pw is defined and icinga2.notifications.xmpp.pw
tags:
- 'role::icinga2-3rdparty-notifications-xmpp'
- name: Remove XMPP notification support
file:
path: '/etc/icinga2/conf.d/notifications-xmppnotify.conf'
state: absent
when: not (icinga2.notifications.xmpp.jid is defined and icinga2.notifications.xmpp.jid and icinga2.notifications.xmpp.pw is defined and icinga2.notifications.xmpp.pw)
notify: reload icinga2
- import_tasks: icinga2-3rdparty-commands-openvpn.yml
tags:
- 'role::icinga2-3rdparty-commands-openvpn'
......
......@@ -7,7 +7,7 @@ template Notification "xmpp-host-notification" {
types = [ Problem, Acknowledgement, Recovery, Custom ]
period = "24x7"
interval = {{ icinga2.xmpp_interval | default("30m") }}
interval = {{ icinga2.notifications.xmpp.interval | default("30m") }}
vars += {
notification_icingaweb2url = "https://{{ inventory_hostname }}"
......@@ -21,7 +21,7 @@ template Notification "xmpp-service-notification" {
types = [ Problem, Acknowledgement, Recovery, Custom ]
period = "24x7"
interval = {{ icinga2.xmpp_interval | default("30m") }}
interval = {{ icinga2.notifications.xmpp.interval | default("30m") }}
vars += {
notification_icingaweb2url = "https://{{ inventory_hostname }}"
......
# {{ ansible_managed }}
[Account]
jid={{ icinga2.xmpp.jid }}
password={{ icinga2.xmpp.pw }}
nick={{ icinga2.xmpp.nick }}
jid={{ icinga2.notifications.xmpp.jid }}
password={{ icinga2.notifications.xmpp.pw }}
nick={{ icinga2.notifications.xmpp.nick }}
......@@ -15,11 +15,11 @@ apply Notification "mail-icingaadmin" to Host {
user_groups = host.vars.notification.mail.groups
users = host.vars.notification.mail.users
interval = {{ icinga2.mail_interval | default("30m") }}
interval = {{ icinga2.notifications.mail.interval | default("30m") }}
//vars.notification_logtosyslog = true
{% if icinga2.mail_sender is defined %}
vars.notification_from = "<{{ icinga2.mail_sender }}>"
{% if icinga2.notifications.mail.sender is defined %}
vars.notification_from = "<{{ icinga2.notifications.mail.sender }}>"
{% endif %}
assign where host.vars.notification.mail
}
......@@ -29,11 +29,11 @@ apply Notification "mail-icingaadmin" to Service {
user_groups = host.vars.notification.mail.groups
users = host.vars.notification.mail.users
interval = {{ icinga2.mail_interval | default("30m") }}
interval = {{ icinga2.notifications.mail.interval | default("30m") }}
//vars.notification_logtosyslog = true
{% if icinga2.mail_sender is defined %}
vars.notification_from = "<{{ icinga2.mail_sender }}>"
{% if icinga2.notifications.mail.sender is defined %}
vars.notification_from = "<{{ icinga2.notifications.mail.sender }}>"
{% endif %}
assign where host.vars.notification.mail
......
Supports Markdown
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