You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The role task currently assumes the database socket (if used) is auth-less and port-less. However in some circumstances (like when using pgbouncer locally, to access a remote db), passwords and ports are necessary to define for the socket.
This behavior could be controlled with a simple variable flag, for example: netbox_database_use_alt_socket: true to ensure only one type of socket validation task is used.
- name: Ensure Postgres database exists (via socket with password/port)community.postgresql.postgresql_db:
name: "{{ netbox_database }}"login_user: "{{ netbox_database_user }}"login_unix_socket: "{{ netbox_database_socket }}"port: "{{ netbox_database_port }}"login_password: "{{ netbox_database_password }}"maintenance_db: "{{ netbox_database_maintenance }}"become: truebecome_user: "{{ netbox_database_user }}"when:
- netbox_database_socket is defined
- netbox_database_use_alt_socket
- netbox_database_host is not defined
The text was updated successfully, but these errors were encountered:
I believe we can still use the same task, just use the omit filter for the port/login password.
Although since netbox_database_port technically has a default I guess omit wouldn't make any difference, but I'm not sure if specifying it here for standard socket use will cause a problem or not.
The role task currently assumes the database socket (if used) is auth-less and port-less. However in some circumstances (like when using
pgbouncer
locally, to access a remote db), passwords and ports are necessary to define for the socket.This behavior could be controlled with a simple variable flag, for example:
netbox_database_use_alt_socket: true
to ensure only one type of socket validation task is used.The text was updated successfully, but these errors were encountered: