Compare commits
2 Commits
f224e974b0
...
c8aca90278
| Author | SHA1 | Date | |
|---|---|---|---|
| c8aca90278 | |||
| 3c6f49ae31 |
@@ -62,7 +62,7 @@ services:
|
||||
volumes:
|
||||
- ./files/icinga2:/data
|
||||
ports:
|
||||
- ${ICINGA_API_PORT:5665}:5665 # only need if you plan to use api from other sources as icingaweb2
|
||||
- ${ICINGA_API_PORT:-5665}:5665 # only need if you plan to use api from other sources as icingaweb2
|
||||
networks:
|
||||
- icinga
|
||||
#- backend
|
||||
|
||||
19
init.sh
19
init.sh
@@ -22,14 +22,6 @@ if [ -z "$(ls -A /data)" ]; then
|
||||
mv $ICINGA2_CONF_DIR/hosts.conf $ICINGA2_ZONE_MASTER/
|
||||
mv $ICINGA2_CONF_DIR/*.conf $ICINGA2_GLOBAL_TEMPLATES/
|
||||
mv $ICINGA2_GLOBAL_TEMPLATES/api-users.conf $ICINGA2_CONF_DIR/
|
||||
fi
|
||||
|
||||
|
||||
## only on inital setup replace one time the api root user password if a env var is set
|
||||
if [ ! -z "$ICINGA2_API_USER_ROOT_PASS" ]; then
|
||||
echo set inital api root user password
|
||||
sed -i "s|password = \".*\"|password = \"$ICINGA2_API_USER_ROOT_PASS\"|g" $ICINGA2_FILE_API_USER_CONF
|
||||
fi
|
||||
|
||||
## only on inital setup create a icingaweb api user if env var is set
|
||||
## permission source: https://icinga.com/docs/icinga-web/latest/modules/monitoring/doc/05-Command-Transports/
|
||||
@@ -44,13 +36,22 @@ fi
|
||||
## only on inital setup create a pki-ticket api user if env var is set
|
||||
## permission source: https://icinga.com/docs/icinga-2/latest/doc/06-distributed-monitoring/#csr-auto-signing-on-the-master
|
||||
if [ ! -z "$ICINGA2_API_USER_SATELLITE_PASS" ]; then
|
||||
echo set inital icingadb api user
|
||||
echo set inital pki-ticket api user
|
||||
echo 'object ApiUser "pki-ticket" {' >> $ICINGA2_FILE_API_USER_CONF
|
||||
echo " password = \"$ICINGA2_API_USER_SATELLITE_PASS\"" >> $ICINGA2_FILE_API_USER_CONF
|
||||
echo ' permissions = [ "actions/generate-ticket" ]' >> $ICINGA2_FILE_API_USER_CONF
|
||||
echo '}' >> $ICINGA2_FILE_API_USER_CONF
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
## only on inital setup replace one time the api root user password if a env var is set
|
||||
if [ ! -z "$ICINGA2_API_USER_ROOT_PASS" ]; then
|
||||
echo set inital api root user password
|
||||
sed -i "s|password = \".*\"|password = \"$ICINGA2_API_USER_ROOT_PASS\"|g" $ICINGA2_FILE_API_USER_CONF
|
||||
fi
|
||||
|
||||
|
||||
## enable icingadb feature if not active
|
||||
if [ ! -f "$ICINGA2_FILE_ICINGADB_CONF" ]; then
|
||||
|
||||
Reference in New Issue
Block a user