From 44ec9845521c5cca8eb0e02b0f2e9ff198c61dc3 Mon Sep 17 00:00:00 2001 From: cronekorkn Date: Sat, 18 Feb 2023 14:04:35 +0100 Subject: [PATCH] icinga setup is working now --- bundles/icinga2/files/features/mainlog.conf | 4 ++++ bundles/icinga2/items.py | 21 ++++++++++++++++++++- bundles/icinga2/metadata.py | 1 - bundles/icingaweb2/README.md | 1 + bundles/icingaweb2/metadata.py | 3 +-- 5 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 bundles/icinga2/files/features/mainlog.conf diff --git a/bundles/icinga2/files/features/mainlog.conf b/bundles/icinga2/files/features/mainlog.conf new file mode 100644 index 0000000..1a56d26 --- /dev/null +++ b/bundles/icinga2/files/features/mainlog.conf @@ -0,0 +1,4 @@ +/** + * This file is requires for inital apt install. + * The JournaldLogger type writes log information to the systemd journal. + */ diff --git a/bundles/icinga2/items.py b/bundles/icinga2/items.py index 8fb91f4..861dc1f 100644 --- a/bundles/icinga2/items.py +++ b/bundles/icinga2/items.py @@ -10,6 +10,24 @@ directories = { 'svc_systemd:icinga2.service:restart', ], }, + '/etc/icinga2/pki': { # required for apt install + 'purge': True, + 'owner': 'nagios', + 'group': 'nagios', + 'mode': '0750', + 'triggers': [ + 'svc_systemd:icinga2.service:restart', + ], + }, + '/etc/icinga2/zones.d': { # required for apt install + 'purge': True, + 'owner': 'nagios', + 'group': 'nagios', + 'mode': '0750', + 'triggers': [ + 'svc_systemd:icinga2.service:restart', + ], + }, '/etc/icinga2/conf.d': { 'purge': True, 'owner': 'nagios', @@ -195,7 +213,8 @@ files = { # FEATURES for feature, context in { - 'journald': {}, + 'mainlog': {}, +# 'journald': {}, FIXME 'notification': {}, 'checker': {}, 'api': {}, diff --git a/bundles/icinga2/metadata.py b/bundles/icinga2/metadata.py index 58ef786..7e58d3f 100644 --- a/bundles/icinga2/metadata.py +++ b/bundles/icinga2/metadata.py @@ -49,7 +49,6 @@ defaults = { 'mountpoint': '/var/lib/icinga2', 'needed_by': { 'pkg_apt:icinga2', - 'pkg_apt:icingaweb2', 'pkg_apt:icinga2-ido-pgsql', }, }, diff --git a/bundles/icingaweb2/README.md b/bundles/icingaweb2/README.md index 18e3c30..935b6e2 100644 --- a/bundles/icingaweb2/README.md +++ b/bundles/icingaweb2/README.md @@ -2,3 +2,4 @@ - open /icingaweb2/setup in browser - fill in values from metadata - apply +- make sure tls cert exists and is owned by nagios diff --git a/bundles/icingaweb2/metadata.py b/bundles/icingaweb2/metadata.py index 6ff8618..5e78709 100644 --- a/bundles/icingaweb2/metadata.py +++ b/bundles/icingaweb2/metadata.py @@ -3,7 +3,6 @@ from hashlib import sha3_256 defaults = { 'apt': { 'packages': { - 'icingaweb2': {}, 'php-ldap': {}, 'php-json': {}, 'php-intl': {}, @@ -11,11 +10,11 @@ defaults = { 'php-gd': {}, 'php-imagick': {}, 'php-pgsql': {}, + 'icingaweb2': {}, 'icingaweb2-module-monitoring': {}, }, 'sources': { 'deb https://packages.icinga.com/debian icinga-{release} main', - 'deb https://packages.icinga.com/debian icinga-{release}-snapshots main', }, }, 'icingaweb2': {