More (and better) variables
This commit is contained in:
parent
4c9dbfce50
commit
6b24c3daac
@ -6,8 +6,9 @@ services:
|
|||||||
context: ./image-files
|
context: ./image-files
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
environment:
|
environment:
|
||||||
- HOST=
|
- CN=
|
||||||
- MASTERHOST=
|
- ZONE=
|
||||||
- MASTERPORT=5665
|
- PARENTHOST=
|
||||||
|
- PARENTCN=
|
||||||
- PARENTZONE=
|
- PARENTZONE=
|
||||||
- TICKET=
|
- TICKET=
|
||||||
|
@ -1,19 +1,37 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
icinga2 pki new-cert --cn $HOST \
|
|
||||||
--key /var/lib/icinga2/certs/${HOST}.key \
|
|
||||||
--cert /var/lib/icinga2/certs/${HOST}.crt
|
|
||||||
|
|
||||||
icinga2 pki save-cert --key /var/lib/icinga2/certs/${HOST}.key \
|
# If parent cn is not specified, default it to the parent host.
|
||||||
--cert /var/lib/icinga2/certs/${HOST}.crt \
|
# If the zone if not specified, default it to the cn of the satellite/agent.
|
||||||
--trustedcert /var/lib/icinga2/certs/${MASTERHOST}.crt \
|
# Use the default port if none is specified.
|
||||||
--host ${MASTERHOST}
|
|
||||||
|
|
||||||
icinga2 node setup --ticket $TICKET \
|
if [ -z "$PARENTCN" ]; then
|
||||||
--cn $HOST \
|
PARENTCN="$PARENTHOST"
|
||||||
--endpoint ${MASTERHOST},${MASTERHOST},${MASTERPORT} \
|
fi
|
||||||
--zone $HOST \
|
|
||||||
--parent_zone $PARENTZONE \
|
if [ -z "$ZONE" ]; then
|
||||||
--parent_host $MASTERHOST \
|
ZONE="$CN"
|
||||||
--trustedcert /var/lib/icinga2/certs/${MASTERHOST}.crt \
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PARENTPORT" ]; then
|
||||||
|
PARENTPORT=5665
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
icinga2 pki new-cert --cn "$CN" \
|
||||||
|
--key /var/lib/icinga2/certs/"${CN}".key \
|
||||||
|
--cert /var/lib/icinga2/certs/"${CN}".crt
|
||||||
|
|
||||||
|
icinga2 pki save-cert --key /var/lib/icinga2/certs/"${CN}".key \
|
||||||
|
--cert /var/lib/icinga2/certs/"${CN}".crt \
|
||||||
|
--trustedcert /var/lib/icinga2/certs/"${PARENTCN}".crt \
|
||||||
|
--host "${PARENTHOST}"
|
||||||
|
|
||||||
|
icinga2 node setup --ticket "$TICKET" \
|
||||||
|
--cn "$CN" \
|
||||||
|
--endpoint "${PARENTCN}","${PARENTHOST}","${PARENTPORT}" \
|
||||||
|
--zone "$ZONE" \
|
||||||
|
--parent_zone "$PARENTZONE" \
|
||||||
|
--parent_host "$PARENTHOST" \
|
||||||
|
--trustedcert /var/lib/icinga2/certs/"${PARENTCN}".crt \
|
||||||
--accept-commands --accept-config \
|
--accept-commands --accept-config \
|
||||||
--disable-confd
|
--disable-confd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user