__netbox: add more database parameters

This commit is contained in:
matze 2020-08-22 15:53:24 +02:00
parent ce77cc4527
commit 987393942b
7 changed files with 23 additions and 2 deletions

View file

@ -19,8 +19,8 @@ DATABASE = {
'NAME': '$DATABASE_NAME', # Database name
'USER': '$DATABASE_USER', # PostgreSQL username
'PASSWORD': '$DATABASE_PASSWORD', # PostgreSQL password
'HOST': 'localhost', # Database server
'PORT': '', # Database port (leave blank for default)
'HOST': '$DATABASE_HOST', # Database server
'PORT': '$DATABASE_PORT', # Database port (leave blank for default)
'CONN_MAX_AGE': 300, # Max database connection age
}

View file

@ -26,6 +26,9 @@ version
database
PostgreSQL database name.
database-user
PostgreSQL database user.
database-password
PostgreSQL database password.
@ -39,6 +42,12 @@ host
OPTIONAL PARAMETERS
-------------------
database-host
PostgreSQL database hostname. Defaults to ``localhost``.
database-port
PostgreSQL database port. Defaults to empty (uses the default port).
ldap-server
LDAP server URI. Enables LDAP-backed authentication if specified.

View file

@ -26,8 +26,15 @@ esac
DATABASE_NAME=$(cat "$__object/parameter/database")
export DATABASE_NAME
DATABASE_USER="$(cat "$__object/parameter/database-user")"
export DATABASE_USER
DATABASE_PASSWORD=$(cat "$__object/parameter/database-password")
export DATABASE_PASSWORD
DATABASE_HOST="$(cat "$__object/parameter/database-host")"
export DATABASE_HOST
DATABASE_PORT="$(cat "$__object/parameter/database-port")"
export DATABASE_PORT
ALLOWED_HOST=$(cat "$__object/parameter/host")
export ALLOWED_HOST
SECRET_KEY=$(cat "$__object/parameter/secret-key")

View file

@ -0,0 +1 @@
localhost

View file

@ -0,0 +1 @@

View file

@ -1,3 +1,5 @@
database-host
database-port
ldap-server
ldap-bind-dn
ldap-bind-password

View file

@ -1,5 +1,6 @@
version
database
database-user
database-password
secret-key
host