__netbox: repalace tabs with whitespaces

Doing `s/\t/    /g` to have all times the same indents.
This commit is contained in:
matze 2020-08-22 21:58:44 +02:00
parent ce47cec2e7
commit 4a04a2c472
3 changed files with 61 additions and 61 deletions

View file

@ -43,7 +43,7 @@ AUTH_LDAP_USER_ATTR_MAP = {
EOF EOF
if [ "$LDAP_GROUP_BASE" != "" ]; then if [ "$LDAP_GROUP_BASE" != "" ]; then
cat << EOF cat << EOF
# This search ought to return all groups to which the user belongs. django_auth_ldap uses this to determine group # This search ought to return all groups to which the user belongs. django_auth_ldap uses this to determine group
# hierarchy. # hierarchy.
@ -55,21 +55,21 @@ AUTH_LDAP_GROUP_TYPE = PosixGroupType()
AUTH_LDAP_MIRROR_GROUPS = True AUTH_LDAP_MIRROR_GROUPS = True
EOF EOF
if [ "$LDAP_REQUIRE_GROUP" != "" ]; then if [ "$LDAP_REQUIRE_GROUP" != "" ]; then
cat << EOF cat << EOF
# Define a group required to login. # Define a group required to login.
AUTH_LDAP_REQUIRE_GROUP = "$LDAP_REQUIRE_GROUP" AUTH_LDAP_REQUIRE_GROUP = "$LDAP_REQUIRE_GROUP"
EOF EOF
fi fi
if [ "$LDAP_SUPERUSER_GROUP" != "" ]; then if [ "$LDAP_SUPERUSER_GROUP" != "" ]; then
cat << EOF cat << EOF
# Define special user types using groups. Exercise great caution when assigning superuser status. # Define special user types using groups. Exercise great caution when assigning superuser status.
AUTH_LDAP_USER_FLAGS_BY_GROUP = { AUTH_LDAP_USER_FLAGS_BY_GROUP = {
"is_superuser": "$LDAP_SUPERUSER_GROUP", "is_superuser": "$LDAP_SUPERUSER_GROUP",
} }
EOF EOF
fi fi
fi fi

View file

@ -144,16 +144,16 @@ EXAMPLES
.. code-block:: sh .. code-block:: sh
__netbox --version 2.8.7 --database netbox \ __netbox --version 2.8.7 --database netbox \
--database-password "secretsecretsecret" \ --database-password "secretsecretsecret" \
--secret-key "secretsecretsecret" \ --secret-key "secretsecretsecret" \
--host "${__target_host:?}" \ --host "${__target_host:?}" \
--ldap-server "ldaps://ldap.domain.tld" \ --ldap-server "ldaps://ldap.domain.tld" \
--ldap-bind-dn "uid=netbox,ou=services,dc=domain,dc=tld" \ --ldap-bind-dn "uid=netbox,ou=services,dc=domain,dc=tld" \
--ldap-bind-password "secretsecretsecret" \ --ldap-bind-password "secretsecretsecret" \
--ldap-user-base "ou=users,dc=domain,dc=tld" \ --ldap-user-base "ou=users,dc=domain,dc=tld" \
--ldap-group-base "ou=groups,dc=domain,dc=tld" \ --ldap-group-base "ou=groups,dc=domain,dc=tld" \
--ldap-require-group "cn=netbox-login,ou=groups,dc=domain,dc=tld" \ --ldap-require-group "cn=netbox-login,ou=groups,dc=domain,dc=tld" \
--ldap-superuser-group "cn=netbox-admin,ou=groups,dc=domain,dc=tld" --ldap-superuser-group "cn=netbox-admin,ou=groups,dc=domain,dc=tld"
NOTES NOTES

View file

@ -3,24 +3,24 @@
os=$(cat "$__global/explorer/os") os=$(cat "$__global/explorer/os")
case "$os" in case "$os" in
debian|ubuntu) debian|ubuntu)
# Install netbox dependencies. # Install netbox dependencies.
for pkg in python3-pip python3-venv python3-dev build-essential libxml2-dev \ for pkg in python3-pip python3-venv python3-dev build-essential libxml2-dev \
libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev curl virtualenv sudo; do libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev curl virtualenv sudo; do
__package $pkg __package $pkg
done done
if [ -f "$__object/parameter/ldap-server" ]; then if [ -f "$__object/parameter/ldap-server" ]; then
for pkg in libldap2-dev libsasl2-dev libssl-dev; do for pkg in libldap2-dev libsasl2-dev libssl-dev; do
__package $pkg __package $pkg
done done
fi fi
;; ;;
*) *)
printf "Your operating system (%s) is currently not supported by this type (%s)\n" "$os" "${__type##*/}" >&2 printf "Your operating system (%s) is currently not supported by this type (%s)\n" "$os" "${__type##*/}" >&2
printf "Please contribute an implementation for it if you can.\n" >&2 printf "Please contribute an implementation for it if you can.\n" >&2
exit 1 exit 1
;; ;;
esac esac
@ -41,38 +41,38 @@ SECRET_KEY=$(cat "$__object/parameter/secret-key")
export SECRET_KEY export SECRET_KEY
if [ -f "$__object/parameter/ldap-server" ]; then if [ -f "$__object/parameter/ldap-server" ]; then
LDAP_SERVER=$(cat "$__object/parameter/ldap-server") LDAP_SERVER=$(cat "$__object/parameter/ldap-server")
export LDAP_SERVER export LDAP_SERVER
fi fi
if [ -f "$__object/parameter/ldap-bind-dn" ]; then if [ -f "$__object/parameter/ldap-bind-dn" ]; then
LDAP_BIND_DN=$(cat "$__object/parameter/ldap-bind-dn") LDAP_BIND_DN=$(cat "$__object/parameter/ldap-bind-dn")
export LDAP_BIND_DN export LDAP_BIND_DN
fi fi
if [ -f "$__object/parameter/ldap-bind-password" ]; then if [ -f "$__object/parameter/ldap-bind-password" ]; then
LDAP_BIND_PASSWORD=$(cat "$__object/parameter/ldap-bind-password") LDAP_BIND_PASSWORD=$(cat "$__object/parameter/ldap-bind-password")
export LDAP_BIND_PASSWORD export LDAP_BIND_PASSWORD
fi fi
if [ -f "$__object/parameter/ldap-user-base" ]; then if [ -f "$__object/parameter/ldap-user-base" ]; then
LDAP_USER_BASE=$(cat "$__object/parameter/ldap-user-base") LDAP_USER_BASE=$(cat "$__object/parameter/ldap-user-base")
export LDAP_USER_BASE export LDAP_USER_BASE
fi fi
if [ -f "$__object/parameter/ldap-group-base" ]; then if [ -f "$__object/parameter/ldap-group-base" ]; then
LDAP_GROUP_BASE=$(cat "$__object/parameter/ldap-group-base") LDAP_GROUP_BASE=$(cat "$__object/parameter/ldap-group-base")
export LDAP_GROUP_BASE export LDAP_GROUP_BASE
fi fi
if [ -f "$__object/parameter/ldap-require-group" ]; then if [ -f "$__object/parameter/ldap-require-group" ]; then
LDAP_REQUIRE_GROUP=$(cat "$__object/parameter/ldap-require-group") LDAP_REQUIRE_GROUP=$(cat "$__object/parameter/ldap-require-group")
export LDAP_REQUIRE_GROUP export LDAP_REQUIRE_GROUP
fi fi
if [ -f "$__object/parameter/ldap-superuser-group" ]; then if [ -f "$__object/parameter/ldap-superuser-group" ]; then
LDAP_SUPERUSER_GROUP=$(cat "$__object/parameter/ldap-superuser-group") LDAP_SUPERUSER_GROUP=$(cat "$__object/parameter/ldap-superuser-group")
export LDAP_SUPERUSER_GROUP export LDAP_SUPERUSER_GROUP
fi fi
# have default values # have default values
@ -123,12 +123,12 @@ BASEPATH="$(cat "$__object/parameter/basepath")"
export BASEPATH export BASEPATH
if [ -f "$__object/parameter/http-proxy" ]; then if [ -f "$__object/parameter/http-proxy" ]; then
HTTP_PROXY=$(cat "$__object/parameter/http-proxy") HTTP_PROXY=$(cat "$__object/parameter/http-proxy")
export HTTP_PROXY export HTTP_PROXY
fi fi
if [ -f "$__object/parameter/https-proxy" ]; then if [ -f "$__object/parameter/https-proxy" ]; then
HTTPS_PROXY=$(cat "$__object/parameter/https-proxy") HTTPS_PROXY=$(cat "$__object/parameter/https-proxy")
export HTTPS_PROXY export HTTPS_PROXY
fi fi
if [ -f "$__object/parameter/login-required" ]; then if [ -f "$__object/parameter/login-required" ]; then
@ -149,23 +149,23 @@ mkdir -p "$__object/files"
require="__user/netbox" __directory /opt/netbox/netbox/cdist --parents require="__user/netbox" __directory /opt/netbox/netbox/cdist --parents
require="__directory/opt/netbox/netbox/cdist " __file \ require="__directory/opt/netbox/netbox/cdist " __file \
/opt/netbox/netbox/cdist/configuration.py --mode 640 --owner netbox \ /opt/netbox/netbox/cdist/configuration.py --mode 640 --owner netbox \
--source "$__object/files/configuration.py" --source "$__object/files/configuration.py"
if [ -f "$__object/parameter/ldap-server" ]; then if [ -f "$__object/parameter/ldap-server" ]; then
require="__directory/opt/netbox/netbox/cdist " __file \ require="__directory/opt/netbox/netbox/cdist " __file \
/opt/netbox/netbox/cdist/ldap_config.py --mode 640 --owner netbox \ /opt/netbox/netbox/cdist/ldap_config.py --mode 640 --owner netbox \
--source "$__object/files/ldap_config.py" --source "$__object/files/ldap_config.py"
fi fi
# Upload systemd units and gunicorn configuration. # Upload systemd units and gunicorn configuration.
for unit in netbox netbox-rq; do for unit in netbox netbox-rq; do
__systemd_unit $unit.service \ __systemd_unit $unit.service \
--source "$__type/files/$unit.service" \ --source "$__type/files/$unit.service" \
--enablement-state enabled --enablement-state enabled
done done
# Python worker configuration. # Python worker configuration.
require="__user/netbox" __file /opt/netbox/gunicorn.py \ require="__user/netbox" __file /opt/netbox/gunicorn.py \
--mode 644 --source "$__type/files/gunicorn.py" --mode 644 --source "$__type/files/gunicorn.py"