Skip to main content

Postgresql Role

Deploy PostgreSQL as a Podman quadlet.


Variables​

VariableTypeOptionsDefaultDescription
podman_userstring---{{ ansible_user }}system user for rootless podman operations
postgresql_network_enabledbooltrue, falsetruecreate and manage the podman network
postgresql_network_namestring---postgresql-internalpodman network name
postgresql_bind_ipstring---127.0.0.1host IP to bind exposed ports to
postgresql_port_map_enabledbooltrue, falsefalseexpose container ports on the host
postgresql_port_maplist of string---["5432:5432"]host:container port mappings
postgresql_versionstring---18.6-alpinecontainer image version
postgresql_autoupdatebooltrue, falsetrueenable podman auto-update for PostgreSQL
postgresql_backup_autoupdatebooltrue, falsetrueenable podman auto-update for the backup container
postgresql_log_destinationstring---stderrPostgreSQL log destination
postgresql_log_statementstringnone, ddl, mod, allnoneSQL statement logging level
postgresql_log_min_duration_statementinteger---1000log statements running at least this many milliseconds
postgresql_log_connectionsbooltrue, falsetruelog successful connection attempts
postgresql_log_disconnectionsbooltrue, falsetruelog session disconnections
postgresql_log_checkpointsbooltrue, falsetruelog checkpoint activity
postgresql_log_lock_waitsbooltrue, falsetruelog waits exceeding deadlock timeout
postgresql_log_line_prefixstring---%m [%p] db=%d,user=%u,app=%a,client=%hcontext prefix for each PostgreSQL log line
postgresql_admin_databasestring---postgresadministrator database created by the PostgreSQL image
postgresql_admin_userstring---postgresadministrator user created by the PostgreSQL image
postgresql_admin_passwordstring---""password for the PostgreSQL administrator user
postgresql_userslist of dict---[]users to provision; each entry has name and password
postgresql_databaseslist of dict---[]secondary databases to provision and include in backups; each entry has name and owner
postgresql_backup_schedule_timesstring---03:00time of day to run backup (HH:MM format)
postgresql_backup_retention_daysinteger---7number of days to keep backups
postgresql_backup_compressioninteger---6gzip compression level (1-9)
postgresql_extra_fileslist of dict---[]arbitrary file entries with src (controller path) or source (target path), dest, optional mount, mode, and template
postgresql_extra_dirslist of dict---[]arbitrary directory entries with src (controller directory) or source (target path), dest, optional mount and mode
postgresql_entrypointstring---""optional PostgreSQL container entrypoint override
postgresql_backup_entrypointstring---""optional PostgreSQL backup container entrypoint override
postgresql_proxy_enabledbooltrue, falsefalseenable HTTP proxy for image pulls
postgresql_proxy_httpstring---""HTTP proxy URL
postgresql_proxy_httpsstring---""HTTPS proxy URL
postgresql_proxy_no_proxystring---""comma-separated list of proxy exclusions
postgresql_proxy_envlist of string---[]generated proxy environment entries
postgresql_network_driverstring---bridgepodman network driver
postgresql_environment_varsdict---{"POSTGRES_DB":"{{ postgresql_admin_database }}","POSTGRES_USER":"{{ postgresql_admin_user }}","POSTGRES_PASSWORD":"{{ postgresql_admin_password }}"}extra environment variables for the container