Compare commits
No commits in common. "6abfd868db120b956c59c9d525064770b698407f" and "d8f0d49a64b7f0dfbd74b93c460f0d3ba04851f9" have entirely different histories.
6abfd868db
...
d8f0d49a64
4 changed files with 50 additions and 66 deletions
|
@ -5,6 +5,6 @@ include <itl>
|
||||||
include <plugins>
|
include <plugins>
|
||||||
include <plugins-contrib>
|
include <plugins-contrib>
|
||||||
|
|
||||||
include "features-enabled/*.conf"
|
include "features.d/*.conf"
|
||||||
include_recursive "conf.d"
|
include_recursive "conf.d"
|
||||||
include "hosts.d/*.conf"
|
include "hosts.d/*.conf"
|
||||||
|
|
|
@ -28,16 +28,7 @@ directories = {
|
||||||
'svc_systemd:icinga2.service:restart',
|
'svc_systemd:icinga2.service:restart',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'/etc/icinga2/features-available': {
|
'/etc/icinga2/features.d': {
|
||||||
'purge': True,
|
|
||||||
'owner': 'nagios',
|
|
||||||
'group': 'nagios',
|
|
||||||
'mode': '0750',
|
|
||||||
'triggers': [
|
|
||||||
'svc_systemd:icinga2.service:restart',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
'/etc/icinga2/features-enabled': {
|
|
||||||
'purge': True,
|
'purge': True,
|
||||||
'owner': 'nagios',
|
'owner': 'nagios',
|
||||||
'group': 'nagios',
|
'group': 'nagios',
|
||||||
|
@ -178,6 +169,50 @@ files = {
|
||||||
'svc_systemd:icinga2.service:restart',
|
'svc_systemd:icinga2.service:restart',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
'/etc/icinga2/features.d/ido-pgsql.conf': {
|
||||||
|
'source': 'features/ido-pgsql.conf',
|
||||||
|
'content_type': 'mako',
|
||||||
|
'owner': 'nagios',
|
||||||
|
'group': 'nagios',
|
||||||
|
'context': {
|
||||||
|
'db_password': node.metadata.get('postgresql/roles/icinga2/password')
|
||||||
|
},
|
||||||
|
'triggers': [
|
||||||
|
'svc_systemd:icinga2.service:restart',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'/etc/icinga2/features.d/syslog.conf': {
|
||||||
|
'source': 'features/syslog.conf',
|
||||||
|
'owner': 'nagios',
|
||||||
|
'group': 'nagios',
|
||||||
|
'triggers': [
|
||||||
|
'svc_systemd:icinga2.service:restart',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'/etc/icinga2/features.d/notification.conf': {
|
||||||
|
'source': 'features/notification.conf',
|
||||||
|
'owner': 'nagios',
|
||||||
|
'group': 'nagios',
|
||||||
|
'triggers': [
|
||||||
|
'svc_systemd:icinga2.service:restart',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'/etc/icinga2/features.d/checker.conf': {
|
||||||
|
'source': 'features/checker.conf',
|
||||||
|
'owner': 'nagios',
|
||||||
|
'group': 'nagios',
|
||||||
|
'triggers': [
|
||||||
|
'svc_systemd:icinga2.service:restart',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'/etc/icinga2/features.d/api.conf': {
|
||||||
|
'source': 'features/api.conf',
|
||||||
|
'owner': 'nagios',
|
||||||
|
'group': 'nagios',
|
||||||
|
'triggers': [
|
||||||
|
'svc_systemd:icinga2.service:restart',
|
||||||
|
],
|
||||||
|
},
|
||||||
'/var/lib/icinga2/certs/ca.crt': {
|
'/var/lib/icinga2/certs/ca.crt': {
|
||||||
'content_type': 'download',
|
'content_type': 'download',
|
||||||
'source': f'https://letsencrypt.org/certs/isrg-root-x1-cross-signed.pem',
|
'source': f'https://letsencrypt.org/certs/isrg-root-x1-cross-signed.pem',
|
||||||
|
@ -192,38 +227,6 @@ files = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# FEATURES
|
|
||||||
|
|
||||||
for feature, context in {
|
|
||||||
'syslog': {},
|
|
||||||
'notification': {},
|
|
||||||
'checker': {},
|
|
||||||
'api': {},
|
|
||||||
'ido-pgsql': {
|
|
||||||
'db_password': node.metadata.get('postgresql/roles/icinga2/password'),
|
|
||||||
},
|
|
||||||
}.items():
|
|
||||||
files[f'/etc/icinga2/features-available/{feature}.conf'] = {
|
|
||||||
'content_type': 'mako' if context else 'text',
|
|
||||||
'context': context,
|
|
||||||
'source': f'features/{feature}.conf',
|
|
||||||
'owner': 'nagios',
|
|
||||||
'group': 'nagios',
|
|
||||||
'triggers': [
|
|
||||||
'svc_systemd:icinga2.service:restart',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
symlinks[f'/etc/icinga2/features-enabled/{feature}.conf'] = {
|
|
||||||
'target': f'/etc/icinga2/features-available/{feature}.conf',
|
|
||||||
'owner': 'nagios',
|
|
||||||
'group': 'nagios',
|
|
||||||
'triggers': [
|
|
||||||
'svc_systemd:icinga2.service:restart',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
# HOSTS
|
|
||||||
|
|
||||||
for other_node in repo.nodes:
|
for other_node in repo.nodes:
|
||||||
if other_node.dummy:
|
if other_node.dummy:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -24,7 +24,6 @@ def nginx(metadata):
|
||||||
'context': {
|
'context': {
|
||||||
'root': f"/var/www/{metadata.get('mailserver/autoconfig_hostname')}",
|
'root': f"/var/www/{metadata.get('mailserver/autoconfig_hostname')}",
|
||||||
},
|
},
|
||||||
'check_path': '/mail/config-v1.1.xml',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
from shlex import quote
|
|
||||||
from ipaddress import ip_interface
|
from ipaddress import ip_interface
|
||||||
|
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
'apt': {
|
'apt': {
|
||||||
'packages': {
|
'packages': {
|
||||||
|
@ -113,19 +111,3 @@ def letsencrypt(metadata):
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
|
||||||
'monitoring/services',
|
|
||||||
)
|
|
||||||
def monitoring(metadata):
|
|
||||||
return {
|
|
||||||
'monitoring': {
|
|
||||||
'services': {
|
|
||||||
f'HTTP {hostname}': {
|
|
||||||
'vars.command': f"""/usr/bin/curl {quote(hostname + vhost.get('check_path', ''))} -IL --fail"""
|
|
||||||
}
|
|
||||||
for hostname, vhost in metadata.get('nginx/vhosts').items()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue