forked from ungleich-public/cdist-contrib
24 lines
571 B
Bash
Executable File
24 lines
571 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
HOST=""
|
|
while read -r host; do
|
|
# shellcheck disable=SC2089
|
|
HOST="$HOST '$host',"
|
|
done < "$__object/parameter/bind-to"
|
|
# shellcheck disable=SC2090
|
|
export HOST
|
|
|
|
# process template
|
|
mkdir "$__object/files"
|
|
"$__type/files/gunicorn.py.sh" > "$__object/files/gunicorn.py"
|
|
|
|
# gunicorn config file
|
|
__file /opt/netbox/gunicorn.py \
|
|
--mode 644 --owner netbox \
|
|
--source "$__object/files/gunicorn.py"
|
|
|
|
# install service file
|
|
__systemd_unit gunicorn-netbox.service \
|
|
--source "$__type/files/netbox.service" \
|
|
--enablement-state enabled --restart
|