Files
computer-playbook/roles/svc-cache-package
kevinveenbirkenbachandClaude Opus 5 cddca72a03 style: delete the Exception tags this branch added
A comment is a nocheck directive or a parameter doc, and an Exception: label does not make narration into one of them. Four comments go entirely: the seven-line block on why Avestan is absent, whose reason stands in the body of 5faa4d1aec; the anchor-directory note in the package-frontend CA script, which the two paths directly below it already state; and the Sphinx budget note in the docs Playwright env, where a # line is rendered into the .env rather than staying source.

Seven Exception: paragraphs inside docstrings keep their prose and lose only the label. A docstring is a parameter doc and may carry the text; the defect was a prefix claiming a sanction the policy does not grant.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-21 12:52:36 +02:00
..
…
…

Package cache

Description

Nexus Repository is a repository manager that proxies package registries and serves an artefact it has already fetched from local disk. nginx sits in front of it and answers for the upstream hostnames themselves, so a package manager keeps the URLs it was built with and still reads through the proxy.

Overview

The role deploys two containers on its inventory group's host: the repository manager and its nginx frontend. Both run in compose mode on the manager, like the sibling svc-registry-cache.

upstreams.conf.j2 is rendered to the host and mounted into the frontend as conf.d/upstreams.conf. Its content comes from the cache: sections of the roles' meta/networks.yml, so no hostname, repository or upstream URL is written in this role.

compose.cache-consumer.yml.j2, apt.list.j2, npmrc.j2 and pip.conf.j2 under templates/, and the shell scripts under files/, belong to the development compose stack, which drives them through render.py and compose.py. The Ansible deployment reads none of them.

Features

  • Declaration driven: Every proxied repository and every answered hostname comes from the cache: declarations, collected by the cache_upstreams and cache_repos lookups. A new upstream is added by declaring it there.
  • Mirror failover: A repository that declares a mirror is served through a guarded location: a 5xx from its primary remote re-runs the same path against the sibling repository, while a 404 is passed straight back.
  • Persistent store: Proxied artefacts live in a named volume, so a redeploy reuses what earlier runs already pulled.
  • Backup free: The volume is backup-disabled and its backup consumer stays off; every artefact in it is re-fetchable from its upstream.
  • Self-provisioning: A bootstrap sidecar runs bootstrap.sh from inside the stack whenever the cache starts, gated on the repository manager's healthcheck. It re-creates every declared repository on a /nexus-data that came back empty. The deploy runs the same script from the host, over docker exec, so a deployment converges before its tasks finish.