#!/bin/sh : ${icinga_password:='changeme'} : ${icinga_dbhost:="$postgres_host"} : ${icinga_dbname:='icinga'} icinga_dn="uid=${icinga_username},${robots_basedn}" icingaweb_client_keytab="${keytab_dir}/icingaweb.client.keytab" icingadb_conf_dir=/usr/local/etc/icingadb redis_user=redis redis_data_dir=/var/db/redis redis_sock=/var/run/redis/redis.sock redis_port=6379 redis_data_dir=/var/db/redis icinga_psql(){ KRB5CCNAME=MEMORY: KRB5_CLIENT_KTNAME="$icingaweb_client_keytab" \ psql \ --quiet --no-align --tuples-only --echo-all \ --host="$icinga_dbhost" \ --dbname="$icinga_dbname" \ --username="$icinga_username" \ --no-password \ "$@" } # Install packages. pkg install -y \ icingadb \ redis # Create icinga LDAP user, principal, and keytab. # Note that we have a separate userPassword attribute in LDAP because icingadb is # written in golang, and its pq library is not built with GSSAPI support. # GSSAPI *is* supported by icingaweb2 via PHP's PDO, however, so we use it there. # We also need a userPassword attribute for icingaweb2 LDAP binds. ldap_add "$icinga_dn" < /dev/null 2>&1