File tree Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,17 @@ netbox_database_user: netbox
155155#netbox_database_host: localhost
156156netbox_database_port: 5432
157157#netbox_database_socket: /var/run/postgresql
158+ #netbox_database_alt_socket: false
158159----
159160
160161It is *required* to configure either a socket directory (to communicate over UNIX sockets) or a host/password (to use TCP/IP).
161162See the _Example Playbook_ section for more information on configuring the database.
162163
164+ Setting `netbox_database_alt_socket` to `true` will skip the database connectivity check
165+ tasks and also set `netbox_database_port` alongside the socket connection for the
166+ database configuration. This will help with environments that may be running pgbouncer
167+ on the same server as NetBox.
168+
163169Note that these are used to configure `DATABASE` in `configuration.py`.
164170
165171[source,yaml]
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ netbox_database_user: netbox
2222# netbox_database_host: localhost
2323netbox_database_port : 5432
2424# netbox_database_socket: /var/run/postgresql
25+ netbox_database_alt_socket : false
2526netbox_database_conn_age : 0
2627netbox_database_options : {}
2728netbox_database_maintenance : " postgres"
Original file line number Diff line number Diff line change 5252 when :
5353 - netbox_database_socket is defined
5454 - netbox_database_host is not defined
55+ - not netbox_database_alt_socket
5556
5657- name : Ensure Postgres database exists (via TCP)
5758 community.postgresql.postgresql_db :
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ DATABASE = {
2525{% if netbox_database_password is defined % }
2626 'PASSWORD' : '{{ netbox_database_password }}' ,
2727{% endif % }
28+ {% if netbox_database_alt_socket and netbox_database_socket is defined % }
29+ 'PORT' : '{{ netbox_database_port }}' ,
30+ {% endif % }
2831 'HOST' : '{{ netbox_database_socket }}' ,
2932{% endif % }
3033 'CONN_MAX_AGE' : {{ netbox_database_conn_age }},
You can’t perform that action at this time.
0 commit comments