Feature #23238
closedAnsible installer can install PostgreSQL packages from postgresql.org
Description
The Ansible installer needs to be able to install arbitrary versions of PostgreSQL in order to match, e.g., the database deployed with RDS. postgresql.org publishes packages we can use to do this. Users will configure this using two variables across our roles:
# Can name a version number like 15, 17, etc. arvados_postgresql_version: null # Can be either "distro" or "postgresql" arvados_postgresql_repository: distro
Add a role distro_postgresql that:
- depends on
distro_apt when: "arvados_postgresql_repository == 'postgresql'", it uses @deb822_repositoryto set up the postgresql.org package repository and notifies theapt updatehandler fromdistro_apt- otherwise it's a noop
- It is a dependency of
arvados_postgresqlandarvados_api(where we install the client packages)
In arvados_postgresql:
- Remove the separate, older
arvados_postgresql_packagedefault - In the tasks, install
postgresql-{{ arvados_postgresql_version }}if the variable is set, else justpostgresql.
In arvados_api_server, add a task before Install arvados-api-server that says when: "arvados_postgresql_version is truthy", install the postgresql-client-{{ arvados_postgresql_version }} package.
Test the new code with arvados_postgresql_repository set to both distro and postgresql.
Updated by Stephen Smith 4 months ago
ยท Edited
Changes at arvados|6d5ac68a519f772bda45b63b57cdfdc65b7dfde0 branch 23238-ansible-psql-repo
- Added the
distro_postgresqlrole that sets up the postgres repo whenarvados_postgresql_repository = postgresql - Removed
arvados_postgresql_packageand split the package installation into 2 tasks, 1 for normal package and 1 for postgresql repo whenarvados_postgresql_versionis set - Added
postgresql-client-xinstallation task toarvados_api_server
- Tested that using 'distro' and 'postgresql' with a version installs the correct packages
- I noticed I occasionally get
Unable to restart service keepproxy.service: Job for keepproxy.service failed because a timeout was exceededbut re-running the playbook works, so I think this is unrelated and maybe normal?
Updated by Brett Smith 4 months ago
- Target version changed from Development 2025-11-12 to Development 2025-11-26
Updated by Lucas Di Pentima 4 months ago
This LGTM. One thing I would suggest is to add these 2 new vars to the full cluster example inventory, for documentation purposes.
I'm also getting keepproxy starts timeouts on some tests I'm doing, not sure what is going on yet.
Updated by Stephen Smith 4 months ago
- Status changed from In Progress to Resolved
Updated by Brett Smith 4 months ago
- Related to Idea #18337: Easier install using Ansible added