Commit Graph
19 Commits
Author SHA1 Message Date
kevinveenbirkenbachandClaude Opus 5.5 67f6c8d7e8 fix(cache): keep the applications carrier valid across token store writes
Since 778c18fb23 the carrier key holds the tokens file's mtime and size.
sys-token-store changed that stat on every inclusion (00_core.yml
touched the file) and on every persisted token, and nothing re-parked a
carrier afterwards. Every later task's fresh worker then rendered the
applications SPOT cold, 30 to 80 s each. On main fea6f31d9f (run
38812964308) seven heavy jobs logged 194 to 287 such tasks and ran out
of the 20400 s budget; the same jobs before 778c18fb23 logged 65 to 83,
all of them real waits.

- 00_core.yml touches the store with modification_time and access_time
  preserved, so it only creates a missing file. In swarm the controller
  sees the store over NFS with attribute caching, and the touch alone
  made the second pass go cold without any write.
- write.yml re-parks the carrier when the persist or the controller
  mirror changed the store. Both run once, so every host that ran the
  include gets the same verdict.
- tasks/utils/setup/role.yml re-parks after every role on every host,
  so hosts that did not run the writing role recover too. Where the
  key still matches this serves the carried payload; measured 0.1 s per
  role in a local compose deploy.
- The tokens file enters the key as the SHA-256 of its content,
  memoised per inode, mtime and size, so a touch no longer changes the
  key. A stat that still matches serves the memo (1.67 us against
  1.41 us for the old stat signature), and a stale stat keeps key and
  YAML cache on the same old content instead of pairing new content
  with an old key.
- applications_carrier opens the tokens file before it computes the
  key, so on the NFS-mounted controller the parked key reflects the
  revalidated attributes rather than a cached stat that changes a
  minute later.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 11:11:47 +02:00
kevinveenbirkenbach 744cacf77c fix(token-store): mirror the store onto the controller in swarm
The store is written on the stack host, which keeps it single-writer,
but the users lookup that reads it runs on the controller. In compose
those are the same machine, so nothing showed. In swarm a provider wrote
its token to the stack host while a client resolved it on the controller
in the same run and found nothing.

The mirror runs under the same changed condition as the write, so an
unchanged store still touches nothing.
2026-08-10 00:03:17 +02:00
kevinveenbirkenbachandClaude Opus 4.8 4039313266 refactor(tasks): enforce and apply a single task-file numbering scheme
Add tests/lint/repository/test_task_file_numbering.py: numbered task
files use exactly two leading digits, a numbered *_core.yml must be
00_core.yml, per directory the numbers are unique/consecutive and start
at 01 (00 with a core file), numbered includes appear in ascending
order, and shared helpers live in tasks/utils/ instead of the numbered
chain.

Apply it across every role: rename NN_core.yml to 00_core.yml with a
consecutive down-shift of the siblings, move letter-suffix children into
a subdirectory named after their parent task, relocate helpers included
from more than one place into tasks/utils/, and update every reference
(include_tasks, path_absolute, .ansible-lint-ignore, requirement docs).
Legacy narration comments in the touched files are deleted; the upstream
xwiki.properties reference block opts out via nocheck. The unused
MAILU_IP6_PUBLIC var (only ever named in now-removed comments) is dropped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 20:01:31 +02:00
kevinveenbirkenbachandClaude Opus 4.8 cddb0dc59b feat(lint): require emoji-prefixed task/step/job names + convert existing
Add tests/lint/repository/test_name_emoji_and_length.py: every Ansible task
name and GitHub Actions workflow/job/step name must start with an emoji (first
char not 0-9/A-Za-z) and be <= 80 chars.

- emit emoji names at the source: cli/build/include generator now writes
  "🔧 setup <app>" / "🚿 flush handlers after <app>" so generated
  tasks/groups/*-roles.yml satisfy the convention too
- convert existing task/step/job/workflow names to emoji-prefixed, choosing a
  task-fitting icon per action (📦 install, ✅ ensure, 🔍 probe, 🥾 bootstrap,
  🚀 deploy, 🧩 service-module load, ⬇️ checkout, 📂 include-routines, ...)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 22:45:06 +02:00
kevinveenbirkenbachandClaude Opus 4.7 59c221521c fix(cluster-a): NFS-everywhere for cluster-shared /var/lib/infinito state
Resolves CI swarm rc=69 ("msmtp: needs a password"): controller-side
Ansible lookups (lookup('email').password etc.) couldn't see the
tokens.yml that Mailu writes target-side, because the controller has
its own filesystem in swarm mode.

Mount NFS-shared /var/lib/infinito on every swarm host AND on the
controller during deploy (in-play delegate_to: localhost task at end
of svc-storage-nfs-server role). State subdir exported separately
with no_root_squash + wildcard CIDRs so root-owned writes succeed
and the controller can mount from outside the svc-swarm IP set.

Single-writer guarantee on FILE_TOKENS via delegate_to: STACK_HOST +
run_once on sys-token-store/{01_core,write}.yml. Backup roles
(svc-bkp-container-2-local, sys-ctl-cln-bkps, sys-ctl-cln-faild-bkps,
user-backup/03_permissions_folders, three direct callers of
04_seed-database-to-backup.yml) gated on IS_STACK_HOST to prevent
N-host write races on the shared NFS backup tree.

Fail-fast assertion in svc-storage-nfs-client + 05_controller_mount
when pre-existing local /var/lib/infinito would be hidden by mount-
over. Operator must migrate or wipe before re-deploying.

SPOTs: SWARM_LAB_NETWORK in workflow env block, storage.nfs.state_subdir
in group_vars/all/15_storage.yml, DIR_VAR_LIB unchanged. UPPER_CASE
constants in NFS roles. Cleanup script umounts controller view before
container teardown to prevent stale-mount leak between matrix jobs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 19:02:57 +02:00
kevinveenbirkenbachandClaude Opus 4.7 951f6d36d2 chore(lint): unify autoformat/galaxy parallelism into one PARALLEL env var
* scripts/lint/autoformat.sh: rename AUTOFORMAT_PARALLEL to PARALLEL,
  declare it at file start with default `true`; still env-overridable.
  Reword the worker comment so the literal `# shellcheck` token no
  longer appears at start-of-line and trips SC1072/SC1073.
* scripts/lint/galaxy.sh: drop the GALAXY_FATAL / GALAXY_NAMESPACE /
  GALAXY_PARALLEL env vars (over-engineered for a single repo). Failure
  is always fatal. NAMESPACE is an internal constant. Add the same
  PARALLEL env var (default `true`, env-overridable); falsy demotes the
  xargs fan-out to one worker.
* docs/contributing/environment/variables.md: collapse the four
  AUTOFORMAT_*/GALAXY_* rows into one `PARALLEL` row covering both
  consumers.
* docs/contributing/tools/make.md: refer to `PARALLEL=0` everywhere;
  add the lint-galaxy parallelism note.

Plus working-tree drift across roles/, group_vars/, inventories/, and
tasks/ that accumulated from the make-test setup phase regenerating
generated artefacts during recent test runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 00:59:24 +02:00
kevinveenbirkenbachandClaude Opus 4.6 b70a783423 refactor(lookups): migrate to runtime applications/users lookups
Replaces inline `applications`/`users` merging with dedicated lookup
plugins and runtime hydration. Introduces `add_csp_hash` filter,
integrates sort into `find_dock_val_by_bkp_entr`, splits the Keycloak
one-shot realm import into `05a_realm_import_run.yml`, and fixes the
Mastodon administrator task YAML. Removes obsolete `csp_hashes` filter,
`sys-token-store` Jinja filter, and empty CLI setup modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 23:44:19 +02:00
kevinveenbirkenbach e1e1f3eb11 chore(vars): rename PATH_* to DIR_/BIN_/FILE_ conventions
https://chatgpt.com/share/6985cf49-3c74-800f-af97-f68b1969ab01
2026-02-06 12:23:46 +01:00
kevinveenbirkenbach 8a81630391 Added newline at file and POSIX compatible 2026-02-04 19:49:56 +01:00
kevinveenbirkenbach 26ad45bd3f Removed unnecessary setting of token fact 2026-02-04 11:59:55 +01:00
kevinveenbirkenbach 0495dfcfb0 Optimized logging output 2026-01-19 00:56:28 +01:00
kevinveenbirkenbach 45fb54e43a Revert "Changed touch to file"
This reverts commit 707323035a.
2026-01-05 17:09:48 +01:00
kevinveenbirkenbach 528e0ad1f8 Fix Matomo bootstrap and token initialization logic
- Ensure Matomo is bootstrapped when API token is missing, even if already installed
- Make Matomo load conditional on reachability and token availability
- Move run-once flag in sys-token-store to ensure proper token hydration
- Improve trusted_hosts patching to include service and Docker reach host
- Clean up redundant conditions and minor task inconsistencies

https://chatgpt.com/share/6957bc5f-ff70-800f-a3bd-c4cf2518a336
2026-01-02 13:38:48 +01:00
kevinveenbirkenbach 707323035a Changed touch to file 2026-01-02 10:38:50 +01:00
kevinveenbirkenbach 93f09ac0a7 feat(token-store): hydrate runtime tokens + unify Matomo token usage
**Body**

* add sys-token-store filter plugin to hydrate users.*.tokens from persisted store (users win if non-empty)
* load token store during sys-token-store core run and inject hydrated tokens into users fact
* remove legacy lookup task and simplify docs + store path naming
* switch Matomo frontend injection to use hydrated users.administrator.tokens[web-app-matomo] directly
* ensure Mailu token handling uses sys-token-store write task and checks token presence via users.*.tokens
* add unittest for token hydration filter plugin with path-based module loading
2025-12-31 13:43:29 +01:00
kevinveenbirkenbach f3714b00e7 feat(users,token-store): add user token defaults and unify token variable naming
- add `tokens` support to generated default_users
- normalize sys-token-store output variable to `sys_token_store_token`
- align Matomo role to new token-store interface
- reorder Matomo task files for clearer execution flow

https://chatgpt.com/share/69513d00-9a7c-800f-8b1f-5c31e0e21b75
2025-12-28 15:21:35 +01:00
kevinveenbirkenbach f067166095 refactor(secrets): centralize infinito secrets paths and remove role-local csv vars
- introduce global PATH_INFINITO_* secrets paths in group_vars
- replace BKP_DOCKER_2_LOC_DATABASES_CSV with PATH_INFINITO_DATABASE_SECRETS
- align sys-ctl-bkp-docker-2-loc and sys-token-store to shared secrets layout
- remove role-local defaults in favor of global path definitions
- drop outdated Nextcloud backup recovery docs

https://chatgpt.com/share/695132e1-1768-800f-b7e6-b72927f14b81
2025-12-28 14:38:25 +01:00
kevinveenbirkenbach fadde240d8 refactor(tokens): unify token handling via sys-token-store
- Introduce sys-token-store lookup.yml (users → store → empty)
- Introduce sys-token-store write.yml (persist + inject into runtime users)
- Remove all implicit token generation and legacy token tasks
- Migrate Matomo to users.<user>.tokens[application_id]
- Remove redundant Matomo token.value and credentials schema
- Fix Matomo bootstrap env: use MATOMO_ADMIN_USER consistently
- Harden Matomo site verification error handling
- Align sys-front-inj-matomo with unified token model

https://chatgpt.com/share/694d7d55-28a0-800f-8c91-cd09cb9ded7f
2025-12-25 19:07:08 +01:00
kevinveenbirkenbach d3c9380e6b feat(sys-token-store): introduce centralized per-user token store
Add new sys-token-store role to manage per-user, per-app tokens in a single
on-host YAML store.

- Store tokens under /var/lib/infinito/secrets/tokens.yml
- Map users to multiple app tokens (users → tokens → app)
- Ensure secure directories and file permissions
- Load and persist token store server-side (slurp + copy)
- Idempotent token creation and merging
- Generate tokens when missing
- Export resolved token for downstream roles

Constants are defined uppercase, runtime variables lowercase.

https://chatgpt.com/share/694bb78b-45e4-800f-879c-82c11a1b8d0b
2025-12-24 10:50:58 +01:00