3.16. postgresql
By default PostgreSQL is used for all servers and the same role is shared for it. This is optional for Orthanc. There you could also disable this by setting or_use_postgresql to false. Then SQLite would be used. Technically the Tryton kernel used by GNU Health also supports other backends but PostgreSQL is strongly recommended thus this is not configurable inside this project.
On application level the default URI already contains parameters for verifying the TLS connection (see gh_psql_uri_remote). Generally there are three different ways for applications to communicate to PostgreSQL:
UNIX socket (local)
TCP port 5432, unencrypted (remote, forbidden by default)
TCP port 5432, encrypted (remote)
Unencrypted remote access is forbidden by the line in psql_hba_rules. Changing hostssl to host allows both encrypted and unencrypted access.
This role also contains configuration options and automated tasks for preparing the GNU Health demo database and the Thalamus federation database.
If backups are realized using Barman you can find some relevant configuration options below.
Finally all directories are linked into a custom directory /opt/gnuhealth/postgresql/ by default since all elementary services where relocated into /opt/gnuhealth/.
Parameters:
psql_db_users: PostgreSQL users to create
psql_dbs: PostgreSQL databases to create, remove or restore by given owner
psql_listen_remote: Whether PostgreSQL server is expected to listen to remote connections
psql_use_pw: If true use password for users
psql_use_cert: If true handle certificate
psql_pw: Password for user
psql_db_template: Template used for database creation
psql_domain: Domain name of the server
psql_hba_rules: pg_hba rules to manage access. The only present line allows local access, below you can find remote access and barman backup access
psql_encryption: Password encryption method
psql_tls_min: Minimum TLS version to avoid outdated versions with security problems
psql_set_shared_buffers: If true set shared buffers
psql_shared_buffers: Value for shared buffers to increase performance
psql_set_encoding: If true set encoding
psql_encoding: Encoding value to
psql_set_locale: If true set locale
psql_locale: Locale value to set
psql_set_timezone: If true set timezone inside PostgreSQL
psql_timezone: Timezone value to set
psql_set_datestyle: If true set datestyle to control order of months, days and years
psql_datestyle: Datestyle value
psql_barman: Whether barman handles backups
psql_barman_host: Domain name of barman server
psql_barman_host_port: SSH port of barman server
psql_barman_sync: If this server is in synchronization with barman server. This option should allow to have RPO=0 but likely decreases performance.
psql_barman_super_pw: Password of barman super user
psql_barman_replication_pw: Password of barman replication user
Defaults:
psql_set_data_dir: Modify main directory path if true
psql_custom_data_dir: Path of main directory
psql_custom_hba_path: Path of custom HBA file
psql_custom_include_dir: Path of include config directory
psql_custom_log_dir: Path of custom log directory
psql_set_tls_dir: Create TLS directory in custom directory if true
psql_custom_tls_dir: Path of TLS directory
psql_template_comment: Comment put on top of every template delivered by Ansible
psql_cert_path: Path where the server certificate should be put
psql_key_path: Path where the key should be put
psql_package_version_pinning: If true pin package to version below
psql_package_version: Exact package version for installation
psql_ssh_key_path: Path of the private SSH key (public will be the same + ‘.pub’)
psql_ssh_dir: Directory for postgres users SSH, will be created if not present
psql_gh_db_user: PostgreSQL user as owner for GNU Health demo database
psql_gh_demo_db_name: Name of GNU Health demo database
psql_gh_demo_db_version: Version of GNU Health demo database
psql_th_db_user: PostgreSQL user as owner for Thalamus federation database
psql_th_db_name: Name of Thalamus federation database
psql_barman_super_user: Name of PostgreSQL super user for barman
psql_barman_replication_user: Name of PostgreSQL replication user for barman
psql_barman_config_name: Config name for WAL archive command
psql_synchronous_standby_names: Config name for barman server if psql_barman_sync
psql_copy_dump: If the dump for restoring a database is not already on the target system copy it over there
Variables:
psql_packages: System packages needed for installation depending on OS family
psql_os_user: Name of OS user for PostgreSQL, until here always ‘postgres’
psql_home: Home directory of ‘postgres’ user
psql_data_path_freebsd: Data path on FreeBSD, used to check if initdb was called
psql_debian_version: PostgreSQL version of current Debian, needed for custom directory preparations