Commit Graph
47 Commits
Author SHA1 Message Date
kevinveenbirkenbachandClaude Opus 5 8a3cc63af6 test(lint): guard a foreign entry into another role's core
roles/<role>/tasks/main.yml gates 0N_core.yml behind
`run_once_<role> is not defined`. Entering that body from a different role
with `include_role: {name: <role>, tasks_from: 0N_core.yml}` bypasses the
gate, because the guard lives in main.yml and tasks_from never reads it, so
the body runs once per calling task instead of once per play.

For sys-svc-compose that means the shared compose pull-lock directory is wiped
again, and files/python/pull.py skips a pull only while its lock file exists,
so every stack deployed so far pulls again; under MODE_RESET it also reaches
01_reset.yml, which brings every project in DIR_COMPOSITIONS down and deletes
the directory holding every application's instance, env and volume paths. For
sys-svc-container it drains whatever topic is pending through the
unconditional meta: flush_handlers at 00_core.yml:53.

svc-runner carried the only two unguarded entries in the tree. This is not a
new convention: sys-svc-container is guarded this way at seven existing call
sites, in svc-opt-ssd-hdd, sys-ctl-hlth-csp, svc-swarm-node, desk-docker, and
twice inside sys-svc-compose itself.

The guard belongs at the call site rather than inside the core file.
sys-svc-compose/tasks/00_core.yml sets its flag as its first task on purpose:
it includes sys-svc-container, and utils/network/routine.yml leads back into
sys-svc-compose, so setting the flag first is what breaks the recursion. The
first-task lint records that rationale. Moving the flag to the end to let the
body self-guard would trade one defect for another.

The rule parses the task structures rather than matching lines: it walks
block, rescue and always, reads include_role and import_role including the
ansible.builtin spellings, and accepts a guard whether `when` is a scalar or a
list. A line anchor is still used for the report and the nocheck, not for the
verdict. A scratch control covers seven shapes; two of them, an inverted key
order and an entry nested in a block, escape a line-based rule entirely.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 02:40:29 +02:00
kevinveenbirkenbachandClaude Opus 5 575a5a87ac refactor(layout): sort shipped scripts by language and split the unit suite
Every script a role ships now lives under `files/<language>/`, and the unit
suite is split the same way: `tests/unit/python/` beside new sibling trees for
the other languages. `tests/lint/filesystem/test_role_files_layout.py` keeps it
that way; directories whose shape is dictated from outside carry a `.nocheck`
naming the constraint (Docker build contexts, WordPress mu-plugins, the Joomla
extension, Odoo addons, Playwright suites, the `files/test/test.sh` harness
that `test-e2e-cli` resolves generically).

This cannot be applied in halves. Moving a file and repointing what names it
are the same change: 14 references resolve only at deploy time, so the tree is
green either before or after, never between.

Those 14 were found by static resolution over every reference class, not by the
test suite -- a full `make quality-high` was green while all of them were
broken:

  * 7 `src:` values built from a role variable holding a bare filename
    (svc-bkp-remote-2-local, decidim, espocrm, friendica, joomla, pixelfed x2).
    The variable doubles as the destination name inside the container, so the
    language segment belongs at the call site, not in the variable.
  * `sys-service/tasks/04_base.yml` resolved every consumer's systemd script
    through `first_found(..., errors='strict')` over `files/script.{sh,py}`.
    18 roles ship exactly that and have no template fallback: the play would
    have died on each.
  * `sys-front-inj-javascript` fell back to `<role>/files/javascript.js`; the
    interface now reads `files/javascript/javascript.js`.
  * `sys-front-inj-logout/templates/head_sub.j2` built the cache-busting mtime
    path through `path_absolute(... 'files', ...)`.
  * 4 `ansible.builtin.script:` invocations naming a bare command
    (pull.py, prune.sh, set_postgres_superuser_password.sh, ganesha-serve.sh).
  * `dev-python/files/shell/install.sh` pointed at a sibling role's script.

Depth-dependent paths inside the moved trees were bumped accordingly: 59
`parents[N]` computations, 12 relative climbs, and the per-role recover CLI,
whose path `cli/administration/recover/recoverers.py` still assembled from the
pre-move location.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 01:31:09 +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 fbe50d10ed fix(svc-runner): make the runner role swarm-compatible
Workers failed 'docker build: no Dockerfile': the build context, compose file, .env and runner binary were staged on the stack host only while every node deploys its own node-local runner stack. Build and push the image once on the manager (RUNNER_IMAGE_REF via the swarm registry, 04_image.yml) and let workers pull it; render compose.yml (template with lstrip_blocks, matching the replaced stack_host_template action), .env and the extracted run.sh on every node. Add a node_local kwarg to the compose_networks/container_networks/compose_restart/compose_only lookups so this node-local compose stack renders a bridge default network (workers cannot create overlays), keeps restart: unless-stopped (ephemeral runners died after one job) and keeps container_name under swarm; default is unchanged for every other role. Treat build/install.stamp as stale when the venv is missing and exclude ./build from the nested-src copy, closing the nested-e2e ruamel failure class. Regression tests for the node_local render paths; the network include tests now accept lookup kwargs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 02:37:26 +02:00
kevinveenbirkenbachandClaude Fable 5 94e8671d61 refactor(container): route docker ops through the container CLI
community.docker.docker_* module calls in role tasks bypassed the CA-aware container wrapper and split lifecycle handling across two mechanisms. Migrate lifecycle sites (rm/stop/start/run/build, network create) to the container CLI, keep read-only *_info modules with an inline nocheck, and add a lint that rejects new raw module usage. The mariadb recovery flow gains a stale-container pre-remove so an aborted reset stays re-runnable, discourse teardown keeps its graceful stop, and removals guard on 'No such container' instead of masking every failure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 00:00:48 +02:00
kevinveenbirkenbach 9b2f870777 Merge branch 'main' into feature/swarm-nfs 2026-07-01 05:37:36 +02:00
Alejandro Roman b4cf5a4389 refactor code and best pracites 2026-06-24 18:31:23 +02:00
Alejandro Roman 50cc83906b Uppercase cosntants 2026-06-24 18:31:19 +02:00
Alejandro Roman 77817f6e95 Last SPOT changes and resolve comments PR 2026-06-24 18:31:09 +02:00
Alejandro Roman b5de72257d solve last flagged issues in comments 2026-06-24 18:31:07 +02:00
Alejandro Roman 64134bb1cf force restar of containers to avoid issues with old 2026-06-24 18:31:05 +02:00
Alejandro Roman 5cda371cd7 fix: automated runner container approach in any server deployment 2026-06-24 18:31:04 +02:00
Alejandro Roman 3c95edccfe fix svc-runner: skip sudoers task in container (visudo unavailable in test env) 2026-06-24 18:31:03 +02:00
Alejandro Roman a573c1a7a7 fix svc-runner: skip binary extraction if runner already installed 2026-06-24 18:31:01 +02:00
Alejandro Roman f6ce714ab8 fix ansible-lint: add ansible.posix to requirements and use FQCN for sysctl 2026-06-24 18:30:59 +02:00
Alejandro Roman 187a954350 fix CI failures after rebase 2026-06-24 18:30:58 +02:00
Alejandro Roman 0153b5cac1 fix CI failures after rebase 2026-06-24 18:30:58 +02:00
Alejandro Roman 026a1374b3 fix test issues 2026-06-24 18:30:57 +02:00
Alejandro Roman c8705dce1b fix test issue 2026-06-24 18:30:57 +02:00
Alejandro Roman 98c6ed61cb add missing new parts for test 2026-06-24 18:30:57 +02:00
Alejandro Roman 37888708c1 change the runners to be in containers, testing any issues with this last appraoch 2026-06-24 18:30:56 +02:00
Alejandro Roman d89d4facb5 add missing guard 2026-06-24 18:30:55 +02:00
Alejandro Roman b6186d4c07 Adress all missing commetns 2026-06-24 18:30:54 +02:00
Alejandro Roman c34fbf89cb clean last comments 2026-06-24 18:30:53 +02:00
Alejandro Roman 932d0e97df follow SPOT 2026-06-24 18:30:50 +02:00
Alejandro Roman 5e7445ca94 add DinD approach 2026-06-24 18:30:49 +02:00
Alejandro Roman ecb915b06f fix svc runner 2026-06-24 18:30:49 +02:00
Alejandro Roman a6754420cc add a guard for self hosted in svc runner 2026-06-24 18:30:48 +02:00
Alejandro Roman c5f08015dd fix package issue and refactor SPOT violation made by AI 2026-06-24 18:30:47 +02:00
Alejandro Roman 01c4fdc9c9 fix runner issues CI 2026-06-24 18:30:47 +02:00
Alejandro Roman c038d147a3 fix runner issue in DinD + addeed docs for CLI runners 2026-06-24 18:30:46 +02:00
Alejandro Roman aff4a7d158 refactor(svc-runner): fix comments on PR 2026-06-24 18:30:43 +02:00
Alejandro Roman 3e3a24c489 fix(svc-runners): improve cleanup for self hosted and switch to SSD 2026-06-24 18:30:38 +02:00
Alejandro Roman 5567a996c3 fix(svc-runners): cleaning unsued contaienrs, imprve CPU use and cache 2026-06-24 18:30:37 +02:00
Alejandro Roman d3f87ad760 fix(svc-runners): cap CPU use per runner 2026-06-24 18:30:36 +02:00
Alejandro Roman a61e5a9ac0 fix(svc-runners): fix issues with tmpfs access for self hosted 2026-06-24 18:30:36 +02:00
Alejandro Roman 5698d9e708 fix(svc-runners): improve runner speed, use RAm isntead of disk 2026-06-24 18:30:35 +02:00
Alejandro Roman 92838e3a63 fix(svc-runners): improve runners cleaning 2026-06-24 18:30:35 +02:00
Alejandro Roman e36cfcdc75 fix(svc-runners): raise inotify limitis for parallel systemd contianers 2026-06-24 18:30:34 +02:00
Alejandro Roman 8cab0f04da fix(svc-runners): isolate parallel runners (ports, inventory, docker volume, dns) 2026-06-24 18:30:34 +02:00
Alejandro Roman bb2f6ee01e feat(svc-runners): fix CI 2026-06-24 18:30:33 +02:00
Alejandro Roman 7d28cbfbf3 feat(svc-runners): fix CI conflicts 2026-06-24 18:30:33 +02:00
Alejandro Roman 2bd4c07e0b feat(svc-runners): fix container finisher conflicts 2026-06-24 18:30:32 +02:00
Alejandro Roman bcf9e97fda feat(svc-runners): fix container conflicts 2026-06-24 18:30:32 +02:00
Alejandro Roman 3864f2a9c4 feat(svc-runners): fix re-run runners automatic 2026-06-24 18:30:32 +02:00
Alejandro Roman a1c21c31ca feat(svc-runners): add runner to docker group 2026-06-24 18:30:31 +02:00
Alejandro Roman 764a1adf30 feat(svc-runners): add the logic to have x numbers of runners self hosted ad connected to GIthub, allowing to have 20 runners from gh + x self hosted 2026-06-24 18:30:31 +02:00