cdist-contrib/type/__netbox_gunicorn/manifest

22 lines
551 B
Bash
Executable File

#!/bin/sh -e
HOST=""
while read -r host; do
# shellcheck disable=SC2089
HOST="$HOST '$host',"
done < "$__object/parameter/bind-to"
export HOST # shellcheck disable=SC2090
# process template
mkdir "$__object/files"
"$__type/files/gunicorn.py.sh" > "$__object/files/gunicorn.py"
# gunicorn config file
__file /opt/netbox/gunicorn.py \
--mode 644 --source "$__object/files/gunicorn.py"
# install service file
__systemd_unit gunicorn-netbox.service \
--source "$__type/files/netbox.service" \
--enablement-state enabled --restart