forked from ungleich-public/cdist
[new-type] __openldap_server: sudo make nico.happy.
This commit is contained in:
parent
1ad605a509
commit
42914d26c5
1 changed files with 30 additions and 23 deletions
|
@ -9,11 +9,10 @@ slapd_modules=$(cat "${__object}/parameter/module" || true)
|
|||
schemas=$(cat "${__object}/parameter/schema")
|
||||
|
||||
|
||||
OS="$(cat "${__global}/explorer/os")"
|
||||
os="$(cat "${__global}/explorer/os")"
|
||||
|
||||
# Setup OS-dependent vars
|
||||
# TODO: treat other OS better, defaulting to Debian-like
|
||||
case "${OS}" in
|
||||
case "${os}" in
|
||||
freebsd)
|
||||
PKGS="openldap-server"
|
||||
ETC="/usr/local/etc"
|
||||
|
@ -26,7 +25,7 @@ case "${OS}" in
|
|||
slapd_modules="back_mdb back_monitor"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
debian|ubuntu|devuan)
|
||||
PKGS="slapd ldap-utils"
|
||||
ETC="/etc"
|
||||
SLAPD_DIR="/etc/ldap"
|
||||
|
@ -37,6 +36,10 @@ case "${OS}" in
|
|||
slapd_modules="back_mdb ppolicy syncprov back_monitor"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Don't know the openldap defaults for: $os" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
@ -106,8 +109,8 @@ done
|
|||
# TODO: Implement __start_on_boot for BSD
|
||||
require="__package/slapd" __start_on_boot slapd
|
||||
|
||||
# TODO: treat other OS better. Defaulting to Debian-like.
|
||||
if [ "${OS}" != "freebsd" ]; then
|
||||
case "${os}" in
|
||||
debian|ubuntu|devuan)
|
||||
require="__package/slapd" __line rm_slapd_conf \
|
||||
--file ${ETC}/default/slapd \
|
||||
--regex 'SLAPD_CONF=.*' \
|
||||
|
@ -127,7 +130,11 @@ if [ "${OS}" != "freebsd" ]; then
|
|||
--file ${ETC}/default/slapd \
|
||||
--line "SLAPD_SERVICES=\"ldap://localhost/ ldap://${name}/\"" \
|
||||
--state present
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Nothing to do here, move on.
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ -z "${_skip_letsencrypt_cert}" ]; then
|
||||
|
|
Loading…
Reference in a new issue