Skip to content

Commit

Permalink
🐛 NetBox: Fix auth failure for PostgreSQL (#11)
Browse files Browse the repository at this point in the history
When initializing NetBox, an authentication failure for the PostgreSQL
database connection occurs. Make sure to use the right username and
password.

---------

Co-authored-by: Evelyn Alicke <[email protected]>
  • Loading branch information
nomaster and evlli authored Jul 22, 2023
1 parent e224cb7 commit bb3825c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/netbox/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Name of the key in Secret that contains the PostgreSQL password
*/}}
{{- define "netbox.postgresql.secretKey" -}}
{{- if .Values.postgresql.enabled -}}
postgresql-password
password
{{- else if .Values.externalDatabase.existingSecretName -}}
{{ .Values.externalDatabase.existingSecretKey }}
{{- else -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/netbox/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ data:
DATABASE:
{{ if .Values.postgresql.enabled -}}
HOST: {{ include "netbox.postgresql.fullname" . | quote }}
USER: {{ .Values.postgresql.postgresqlUsername | quote }}
NAME: {{ .Values.postgresql.postgresqlDatabase | quote }}
USER: {{ .Values.postgresql.auth.username| quote }}
NAME: {{ .Values.postgresql.auth.database | quote }}
PORT: {{ .Values.postgresql.service.port | int }}
{{- else -}}
HOST: {{ .Values.externalDatabase.host | quote }}
Expand Down
8 changes: 6 additions & 2 deletions charts/netbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,12 @@ postgresql:
# under externalDatabase
enabled: true

postgresqlUsername: netbox
postgresqlDatabase: netbox
service:
port: 5432

auth:
username: netbox
database: netbox

## External database settings
# These are used if postgresql.enabled is false, and are ignored otherwise
Expand Down

0 comments on commit bb3825c

Please sign in to comment.