__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 'NAME': '$DATABASE_NAME', # Database name
'USER': '$DATABASE_USER', # PostgreSQL username 'USER': '$DATABASE_USER', # PostgreSQL username
'PASSWORD': '$DATABASE_PASSWORD', # PostgreSQL password 'PASSWORD': '$DATABASE_PASSWORD', # PostgreSQL password
'HOST': 'localhost', # Database server 'HOST': '$DATABASE_HOST', # Database server
'PORT': '', # Database port (leave blank for default) 'PORT': '$DATABASE_PORT', # Database port (leave blank for default)
'CONN_MAX_AGE': 300, # Max database connection age 'CONN_MAX_AGE': 300, # Max database connection age
} }

View file

@ -26,6 +26,9 @@ version
database database
PostgreSQL database name. PostgreSQL database name.
database-user
PostgreSQL database user.
database-password database-password
PostgreSQL database password. PostgreSQL database password.
@ -39,6 +42,12 @@ host
OPTIONAL PARAMETERS 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
LDAP server URI. Enables LDAP-backed authentication if specified. LDAP server URI. Enables LDAP-backed authentication if specified.

View file

@ -26,8 +26,15 @@ esac
DATABASE_NAME=$(cat "$__object/parameter/database") DATABASE_NAME=$(cat "$__object/parameter/database")
export DATABASE_NAME export DATABASE_NAME
DATABASE_USER="$(cat "$__object/parameter/database-user")"
export DATABASE_USER
DATABASE_PASSWORD=$(cat "$__object/parameter/database-password") DATABASE_PASSWORD=$(cat "$__object/parameter/database-password")
export 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") ALLOWED_HOST=$(cat "$__object/parameter/host")
export ALLOWED_HOST export ALLOWED_HOST
SECRET_KEY=$(cat "$__object/parameter/secret-key") 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-server
ldap-bind-dn ldap-bind-dn
ldap-bind-password ldap-bind-password

View file

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