wip
This commit is contained in:
parent
606a60b1c0
commit
885588910a
5 changed files with 137 additions and 1 deletions
8
bundles/icinga2/files/ido-pgsql.conf
Normal file
8
bundles/icinga2/files/ido-pgsql.conf
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
library "db_ido_pgsql"
|
||||||
|
|
||||||
|
object IdoPgsqlConnection "ido-pgsql" {
|
||||||
|
user = "icinga2",
|
||||||
|
password = "${db_password}",
|
||||||
|
host = "localhost",
|
||||||
|
database = "icinga2"
|
||||||
|
}
|
54
bundles/icinga2/items.py
Normal file
54
bundles/icinga2/items.py
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
# Git-Hash for Icinga1: b63bb0ef52bf213715e567c81e3ed097024e61af
|
||||||
|
|
||||||
|
from json import load
|
||||||
|
from os.path import join
|
||||||
|
|
||||||
|
ICINGA_PLUGINS = {
|
||||||
|
}
|
||||||
|
|
||||||
|
ENABLED_FEATURES = [
|
||||||
|
'ido-pgsql',
|
||||||
|
'notification',
|
||||||
|
]
|
||||||
|
for feature in ENABLED_FEATURES:
|
||||||
|
symlinks[f'/etc/icinga2/features-enabled/{feature}.conf'] = {
|
||||||
|
'target': f'/etc/icinga2/features-available/{feature}.conf',
|
||||||
|
'owner': 'nagios',
|
||||||
|
'group': 'nagios',
|
||||||
|
'needs': [
|
||||||
|
'pkg_apt:icinga2-ido-pgsql',
|
||||||
|
],
|
||||||
|
'triggers': [
|
||||||
|
'svc_systemd:icinga2:restart',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_systemd = {
|
||||||
|
'icinga2': {
|
||||||
|
'needs': [
|
||||||
|
'pkg_apt:icinga2-ido-pgsql',
|
||||||
|
'svc_systemd:postgresql',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
directories = {
|
||||||
|
'/etc/icinga2/features-enabled': {
|
||||||
|
'purge': True,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
files = {
|
||||||
|
'/etc/icinga2/features-available/ido-pgsql.conf': {
|
||||||
|
'source': 'ido-pgsql.conf',
|
||||||
|
'content_type': 'mako',
|
||||||
|
'context': {
|
||||||
|
'db_password': node.metadata.get('postgresql/roles/icinga2/password')
|
||||||
|
},
|
||||||
|
'owner': 'nagios',
|
||||||
|
'group': 'nagios',
|
||||||
|
'needs': [
|
||||||
|
'pkg_apt:icinga2-ido-pgsql',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
44
bundles/icinga2/metadata.py
Normal file
44
bundles/icinga2/metadata.py
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
defaults = {
|
||||||
|
'apt': {
|
||||||
|
'packages': {
|
||||||
|
'icinga2': {},
|
||||||
|
'icingaweb2': {},
|
||||||
|
'icinga2-ido-pgsql': {},
|
||||||
|
'icingacli': {},
|
||||||
|
'monitoring-plugins': {},
|
||||||
|
},
|
||||||
|
'sources': {
|
||||||
|
'deb https://packages.icinga.com/debian icinga-{release} main',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'postgresql': {
|
||||||
|
'databases': {
|
||||||
|
'icinga2': {
|
||||||
|
'owner': 'icinga2',
|
||||||
|
},
|
||||||
|
'icingaweb2': {
|
||||||
|
'owner': 'icingaweb2',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'roles': {
|
||||||
|
'icinga2': {
|
||||||
|
'password': repo.vault.password_for(f'psql icinga2 on {node.name}'),
|
||||||
|
},
|
||||||
|
'icingaweb2': {
|
||||||
|
'password': repo.vault.password_for(f'psql icingaweb2 on {node.name}'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'zfs': {
|
||||||
|
'datasets': {
|
||||||
|
'tank/icinga2': {
|
||||||
|
'mountpoint': '/var/lib/icinga2',
|
||||||
|
'needed_by': {
|
||||||
|
'pkg_apt:icinga2',
|
||||||
|
'pkg_apt:icingaweb2',
|
||||||
|
'pkg_apt:icinga2-ido-pgsql',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
30
data/apt/keys/packages.icinga.com.asc
Normal file
30
data/apt/keys/packages.icinga.com.asc
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
Version: GnuPG v2.0.19 (GNU/Linux)
|
||||||
|
|
||||||
|
mQGiBFKHzk4RBACSHMIFTtfw4ZsNKAA03Gf5t7ovsKWnS7kcMYleAidypqhOmkGg
|
||||||
|
0petiYsMPYT+MOepCJFGNzwQwJhZrdLUxxMSWay4Xj0ArgpD9vbvU+gj8Tb02l+x
|
||||||
|
SqNGP8jXMV5UnK4gZsrYGLUPvx47uNNYRIRJAGOPYTvohhnFJiG402dzlwCg4u5I
|
||||||
|
1RdFplkp9JM6vNM9VBIAmcED/2jr7UQGsPs8YOiPkskGHLh/zXgO8SvcNAxCLgbp
|
||||||
|
BjGcF4Iso/A2TAI/2KGJW6kBW/Paf722ltU6s/6mutdXJppgNAz5nfpEt4uZKZyu
|
||||||
|
oSWf77179B2B/Wl1BsX/Oc3chscAgQb2pD/qPF/VYRJU+hvdQkq1zfi6cVsxyREV
|
||||||
|
k+IwA/46nXh51CQxE29ayuy1BoIOxezvuXFUXZ8rP6aCh4KaiN9AJoy7pBieCzsq
|
||||||
|
d7rPEeGIzBjI+yhEu8p92W6KWzL0xduWfYg9I7a2GTk8CaLX2OCLuwnKd7RVDyyZ
|
||||||
|
yzRjWs0T5U7SRAWspLStYxMdKert9lLyQiRHtLwmlgBPqa0gh7Q+SWNpbmdhIE9w
|
||||||
|
ZW4gU291cmNlIE1vbml0b3JpbmcgKEJ1aWxkIHNlcnZlcikgPGluZm9AaWNpbmdh
|
||||||
|
Lm9yZz6IYAQTEQIAIAUCUofOTgIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJ
|
||||||
|
EMbjGcM0QQaCgSQAnRjXdbsyqziqhmxfAKffNJYuMPwdAKCS/IRCVyQzApFBtIBQ
|
||||||
|
1xuoym/4C7kCDQRSh85OEAgAvPwjlURCi8z6+7i60no4n16dNcSzd6AT8Kizpv2r
|
||||||
|
9BmNBff/GNYGnHyob/DMtmO2esEuVG8w62rO9m1wzzXzjbtmtU7NZ1Tg+C+reU2I
|
||||||
|
GNVu3SYtEVK/UTJHAhLcgry9yD99610tYPN2Fx33Efse94mXOreBfCvDsmFGSc7j
|
||||||
|
GVNCWXpMR3jTYyGj1igYd5ztOzG63D8gPyOucTTl+RWN/G9EoGBv6sWqk5eCd1Fs
|
||||||
|
JlWyQX4BJn3YsCZx3uj1DWL0dAl2zqcn6m1M4oj1ozW47MqM/efKOcV6VvCs9SL8
|
||||||
|
F/NFvZcH4LKzeupCQ5jEONqcTlVlnLlIqId95Z4DI4AV9wADBQf/S6sKA4oH49tD
|
||||||
|
Yb5xAfUyEp5ben05TzUJbXs0Z7hfRQzy9+vQbWGamWLgg3QRUVPx1e4IT+W5vEm5
|
||||||
|
dggNTMEwlLMI7izCPDcD32B5oxNVxlfj428KGllYWCFj+edY+xKTvw/PHnn+drKs
|
||||||
|
LE65Gwx4BPHm9EqWHIBX6aPzbgbJZZ06f6jWVBi/N7e/5n8lkxXqS23DBKemapyu
|
||||||
|
S1i56sH7mQSMaRZP/iiOroAJemPNxv1IQkykxw2woWMmTLKLMCD/i+4DxejE50tK
|
||||||
|
dxaOLTc4HDCsattw/RVJO6fwE414IXHMv330z4HKWJevMQ+CmQGfswvCwgeBP9n8
|
||||||
|
PItLjBQAXIhJBBgRAgAJBQJSh85OAhsMAAoJEMbjGcM0QQaCzpAAmwUNoRyySf9p
|
||||||
|
5G3/2UD1PMueIwOtAKDVVDXEq5LJPVg4iafNu0SRMwgP0Q==
|
||||||
|
=icbY
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
|
@ -18,7 +18,7 @@
|
||||||
'gitea',
|
'gitea',
|
||||||
# 'gollum',
|
# 'gollum',
|
||||||
'grafana',
|
'grafana',
|
||||||
'grub',
|
'icinga2',
|
||||||
'influxdb2',
|
'influxdb2',
|
||||||
'mirror',
|
'mirror',
|
||||||
'postgresql',
|
'postgresql',
|
||||||
|
|
Loading…
Reference in a new issue