Ansible Role linuxfabrik.lfops.repo_postgresql¶
This role deploys the official PostgreSQL Repo.
Available since LFOps 2.0.0.
How the Role Behaves¶
- On RHEL 8 and 9, the role disables the distribution's
postgresqlmodule, so the PostgreSQL packages come from the PGDG repositories. - The PostgreSQL version repositories (
pgdg14topgdg18) getpriority=90, ahead of dnf's default of 99. This deviates from the upstream repository file, which sets no priority: RHEL 10 AppStream shipspostgresql18-*under the same package names as PGDG but with the distribution's file layout (/usr/bin,postgresql-setup), so without the priority dnf would install or update to whichever build has the higher version, while thepostgresql_serverrole relies on the PGDG layout below/usr/pgsql-<version>. The common repository (pgdg-common) keeps the default priority, so packages such aspgbouncer,barmanorpython3-psycopg2still come from whichever repository has the newer build.
Tags¶
repo_postgresql
- Deploys the PostgreSQL Repository.
- Triggers: none.
Optional Role Variables¶
repo_postgresql__basic_auth_login
- Use HTTP basic auth to login to the repository. Only takes effect together with a custom mirror URL; the default public repositories do not use basic auth. Defaults to
lfops__repo_basic_auth_login, making it easy to set this for allrepo_*roles. - Type: String.
- Default:
'{{ lfops__repo_basic_auth_login | default("") }}'
repo_postgresql__mirror_url
- Set the URL to a custom mirror server providing the repository. Defaults to
lfops__repo_mirror_urlto allow easily setting the same URL for allrepo_*roles. Iflfops__repo_mirror_urlis not set, the default mirrors of the repo are used. - Type: String.
- Default:
'{{ lfops__repo_mirror_url | default("") }}'
Example:
# optional
repo_postgresql__basic_auth_login:
username: 'my-username'
password: 'linuxfabrik'
repo_postgresql__mirror_url: 'https://mirror.example.com'