__netbox: add more database parameters
This commit is contained in:
parent
ce77cc4527
commit
987393942b
7 changed files with 23 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
1
type/__netbox/parameter/default/database-host
Normal file
1
type/__netbox/parameter/default/database-host
Normal file
|
@ -0,0 +1 @@
|
|||
localhost
|
1
type/__netbox/parameter/default/database-port
Normal file
1
type/__netbox/parameter/default/database-port
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
database-host
|
||||
database-port
|
||||
ldap-server
|
||||
ldap-bind-dn
|
||||
ldap-bind-password
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
version
|
||||
database
|
||||
database-user
|
||||
database-password
|
||||
secret-key
|
||||
host
|
||||
|
|
Loading…
Reference in a new issue