feat: add postgres_volumes vars for legacy Postgres versions and update docs

- Add `postgres_volumes` configuration with legacy mount path `/var/lib/postgresql/data` to 56 existing host vars files for Postgres versions <= 17
- Skip updates for hosts already using Postgres 18+ or those with existing volume configurations
- Update `AGENTS.md` with session info details for the pi harness
- Fix `roles/odoo/README.md` Ansible command to target `inventories/mint_system`
- Create prompt file documenting the volume configuration migration task
This commit is contained in:
Janik von Rotz committed 2026-09-23 15:02:10 +02:00
1 parent c6a3083f5c
commit 15d16bc573
3 files changed
+65 -1

No files matched your search

+4
View File
@@ -34,6 +34,10 @@ The `./task` file is a bash script that provides all functions necessary to work
**Execute**: Always try to run a command with the `./task` file script.
### Session Info (pi harness)
Inside the **pi** harness, the model ID is in `$PI_MODEL` (e.g. `moonshotai/Kimi-K2.6`), and the session log is at `$PI_SESSION_FILE`. That JSONL file contains token usage in the `message.usage` fields (`input` and `output`). When completing a prompt file, extract the model and cumulative token counts from these sources.
## Coding conventions
### Bash
@@ -0,0 +1,60 @@
---
title: "Add postgres volume config to each host"
state: completed
date_completed: 2026-09-23
model: moonshotai/Kimi-K2.6
input_tokens: 632371
output_tokens: 8617
---
# Run 23
Note: @Clanker refers to the "ai agent" (you) who is working on this task.
@Clanker when working on this task, make sure to:
- Read context and task section first
- Prepare a list of todos
- Update the todo list while working on the task
## Context
@Clanker Read the `AGENTS.md` and `README.md` to get an understanding of the project.
## Task
With postgres 18 the default mount path changes from `/var/lib/postgresql/data` to `/var/lib/postgresql`. I already changed the role default values `roles/postgres/defaults/main.yml`. This change is breaking for all existing postgres configs. I want you to add the `postgres_volumes` vars to all existing postgres deployments. Here is an example: `inventories/mint_system/host_vars/ares_odoo/vars.yml`
Before:
```
# https://hub.docker.com/_/postgres
postgres_image: postgres:14-alpine
postgres_hostname: postgres34
postgres_description: Database odoo01
postgres_user: odoo
```
After:
```
# https://hub.docker.com/_/postgres
postgres_image: postgres:14-alpine
postgres_hostname: postgres34
postgres_description: Database odoo01
postgres_volumes:
- "{{ postgres_volume_name }}:/var/lib/postgresql/data"
postgres_user: odoo
```
Add this for all postgres <= 17.
## Worklog
Added `postgres_volumes` with the legacy mount path `{{ postgres_volume_name }}:/var/lib/postgresql/data` to all existing Postgres deployment configs using an image version <= 17.
- Modified **56** `vars.yml` files across `inventories/mint_system/` and `inventories/opsone/`.
- Skipped `inventories/mint_system/host_vars/themis_odoo/vars.yml` because it uses `postgres:18-alpine` (>= 18, which already uses the new default `/var/lib/postgresql`).
- Skipped `inventories/mint_system/host_vars/ares_odoo/vars.yml` because `postgres_volumes` was already present.
The change ensures existing deployments keep their data in `/var/lib/postgresql/data` even though `roles/postgres/defaults/main.yml` now defaults to `/var/lib/postgresql` for Postgres 18+.
+1 -1
View File
@@ -147,7 +147,7 @@ The amount of workers to be set depends the amount CPUs available on the host.
Get the amount of CPUs on all hosts:
```bash
ansible -i inventories/setup all -m shell -a "grep -c ^processor /proc/cpuinfo"
ansible -i inventories/mint_system all -m shell -a "grep -c ^processor /proc/cpuinfo"
```
Odoo's official formula is: workers = (CPUs × 2) + 1