nginx: remove icinga2, telegraf and pacman references

This commit is contained in:
Rico 2021-12-21 17:16:50 +01:00
parent 1b1c5a8502
commit 927a8f2e0c
Signed by: stillbeben
GPG key ID: AE1066B5BD0B5041
2 changed files with 9 additions and 41 deletions

View file

@ -1,11 +1,10 @@
from datetime import datetime, timedelta
if node.has_bundle('pacman'):
package = 'pkg_pacman:nginx'
username = 'http'
else:
package = 'pkg_apt:nginx'
username = 'www-data'
pkg_apt = {
'nginx': {
'needs': ['file:/etc/apt/sources.list.d/nginx.list'],
},
}
directories = {
'/etc/nginx/sites': {
@ -24,9 +23,9 @@ directories = {
},
},
'/var/log/nginx-timing': {
'owner': username,
'owner': 'http',
'needs': {
package,
'pkg_apt:nginx',
},
},
'/var/www': {},
@ -39,7 +38,7 @@ files = {
'/etc/nginx/nginx.conf': {
'content_type': 'mako',
'context': {
'username': username,
'username': 'http',
**node.metadata['nginx'],
},
'triggers': {
@ -89,7 +88,7 @@ svc_systemd = {
'needs': {
'action:nginx-generate-dhparam',
'directory:/var/log/nginx-timing',
package,
'pkg_apt:nginx',
},
},
}

View file

@ -9,48 +9,17 @@ defaults = {
},
},
},
'packages': {
'nginx': {},
},
},
'backups': {
'paths': {
'/var/www',
},
},
'icinga2_api': {
'nginx': {
'services': {
'NGINX PROCESS': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_systemd_unit nginx',
},
'NGINX STATUS': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_nginx_status',
},
},
},
},
'nginx': {
'worker_connections': 768,
},
'pacman': {
'packages': {
'nginx': {},
},
},
}
if node.has_bundle('telegraf'):
defaults['telegraf'] = {
'input_plugins': {
'builtin': {
'nginx': [{
'urls': ['http://localhost:22999/server_status'],
}],
},
},
}
@metadata_reactor.provides(
'nginx/worker_processes',