It's designed to work with PostgreSQL servers running inside a docker container deployed by [famedly.base.postgresql](https://github.com/famedly/ansible-collection-base/tree/main/roles/postgresql).
The `postgresql_superuser_password` variable must contain the password for the default user `postgres` if the authentication method in `pg_hba.conf` is not `trust`.
When `postgresql_connect_socket` is set to `true`, the role tries to connect to the server via UNIX socket specified in `postgresql_socket_path`.
If it is set to `false`, the connection will be established via TCP socket. If `postgresql_host_port` is set, it will try to connect to this port on `127.0.0.1`, otherwise it will try to find out the container's IP and connect to it on the standard port `5432`.
### `postgresql_client_access_users` list
Here you specify the users you want present or absent. The following features from the [postgresql_user module](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_user_module.html) are supported:
```yaml
postgresql_client_access_users:
- name: user1
password: "{{ vault_user1_postgresql_password }}"
- name: user2
state: absent # defaults to present
```
### `postgresql_client_access_databases` list
Here you specify the database you want to be present or absent. The following features from the [postgresql_db module](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_db_module.html) are supported:
```yaml
postgresql_client_access_databases:
- name: db1
owner: user1
lc_collate: "en_US.utf8" # defaults to 'C'
lc_ctype: "en_US.utf8" # defaults to 'C'
- name: db2
state: absent # defaults to present, only present and absent supported
```
### `postgresql_client_access_databases` list
Here you specify the pg_hba entries you want to be present or absent. The following features from the [postgresql_pg_hba module](https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_pg_hba_module.html) are supported: