diff --git a/src/icinga2/install-service.sh b/src/icinga2/install-service.sh index 98b27ee..d72c47c 100644 --- a/src/icinga2/install-service.sh +++ b/src/icinga2/install-service.sh @@ -288,12 +288,6 @@ _setup() { echo "[INFO] Icinga2 Features werden aktiviert." icinga2 feature enable ido-mysql api influxdb2-writer >/dev/null - echo "[INFO] Icinga Web 2 Module werden in korrekter Reihenfolge aktiviert." - icingacli module enable ipl - icingacli module enable reactbundle - icingacli module enable incubator - icingacli module enable director - echo "[INFO] Erstelle Icinga Web 2 Kernkonfiguration." bash -c "cat > /etc/icingaweb2/config.ini" < /etc/icingaweb2/modules/director/config.ini" </dev/null 2>&1; do + counter=$((counter + 1)) + if [ "$counter" -gt 15 ]; then + echo "[ERROR] Icinga Director wurde nach 30 Sekunden nicht bereit." >&2 + exit 1 + fi + echo "[INFO] Director ist noch nicht bereit, warte 2 Sekunden... (Versuch ${counter}/15)" + sleep 2 + done + echo "[INFO] Icinga Director ist bereit." + echo "[INFO] Icinga Director Setup wird ausgeführt." - # KORREKTUR: kickstart wird nicht mehr benötigt. - icingacli director migration run - icingacli director automation run + icingacli director config set 'endpoint' 'localhost' --user 'director' --password "${ICINGA_API_USER_PASS}" echo "[INFO] Director Konfiguration wird angewendet." icingacli director config deploy }