feat(traefik): add traefik_release_url for a release mirror #445

Open
Claude wants to merge 1 commits from feat/traefik-release-url into main
pull from: feat/traefik-release-url
Owner

What and why

Closes #426

The traefik role hardcoded the GitHub release URLs for the archive and checksums. A new input, traefik_release_url, sets the directory both are downloaded from, for a mirror. The default is the GitHub release directory of traefik_version, so nothing changes for existing hosts.

The default scenario uses it: verify's update path now downloads two stand-in releases that prepare.yml builds under /opt/molecule-download/<version>/. Each has a stub traefik that answers version like the real binary and otherwise sleeps, its archive under the real file name, and a sha256sum checksums file. Nothing binary is committed, and the role's download, checksum check and swap run unchanged. The converge still downloads the real release from GitHub, so the default URL stays covered. traefik_verify_other_version moved to the scenario's group vars so prepare and verify share it. After the update path the installed binary is the stub, so nothing after it asserts real Traefik behaviour (stated in the README and in verify).

Verify replaces the fixed 15 s pause with a poll (30 x 2 s) for the Unable to obtain ACME certificate line that Traefik v3's ACME provider (pkg/provider/acme/provider.go) logs for a failed order or account registration. Only a line whose RFC 3339 stamp, the first field in Traefik's default file log format, is at or after the running process's ExecMainStartTimestamp counts, so a line left by the process converge restarted does not; a missing start time, a missing line or an unparseable stamp fails the check. It then asserts NRestarts is 0, because with Restart=always a crash would otherwise look like a running service.

Verified

  • pre-commit run --files <changed files> and the commit hooks: passed (ansible-lint, yamllint, reuse, antsibull-changelog-lint, gitleaks); ansible-test sanity (pre-push) passed.
  • ansible-playbook --syntax-check on the scenario's converge, prepare and verify playbooks: passed.
  • Ran the role's tasks/binary/download.yml locally against a stand-in built the same way, with a file:// traefik_release_url: download, checksum check and extraction passed, and the extracted stub's version output matches _binary_update's version regex.
  • Ran the ACME wait's shell body against sample logs with systemctl stubbed: it passes only for a matching line stamped after the process start, and fails for an older line, no line, a missing log, an unparseable stamp, and an empty or malformed start time.
  • Two review rounds by a separate agent (argument_specs convention for Jinja defaults, fixture shape vs. download.yml and _binary_update, NRestarts semantics, systemd ≥ 251 in both molecule images for --timestamp=unix, the log format from the role's template).

Not verified

  • The Molecule scenario was not run locally; CI runs it.
  • That this scenario's Traefik logs the ACME failure line in practice: the message and the log format come from the Traefik v3.7.19 source, not from an observed log. If the line never appears, the poll fails loudly after 60 s rather than passing.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Closes #426 The traefik role hardcoded the GitHub release URLs for the archive and checksums. A new input, `traefik_release_url`, sets the directory both are downloaded from, for a mirror. The default is the GitHub release directory of `traefik_version`, so nothing changes for existing hosts. The `default` scenario uses it: verify's update path now downloads two stand-in releases that `prepare.yml` builds under `/opt/molecule-download/<version>/`. Each has a stub `traefik` that answers `version` like the real binary and otherwise sleeps, its archive under the real file name, and a `sha256sum` checksums file. Nothing binary is committed, and the role's download, checksum check and swap run unchanged. The converge still downloads the real release from GitHub, so the default URL stays covered. `traefik_verify_other_version` moved to the scenario's group vars so prepare and verify share it. After the update path the installed binary is the stub, so nothing after it asserts real Traefik behaviour (stated in the README and in verify). Verify replaces the fixed 15 s pause with a poll (30 x 2 s) for the `Unable to obtain ACME certificate` line that Traefik v3's ACME provider (`pkg/provider/acme/provider.go`) logs for a failed order or account registration. Only a line whose RFC 3339 stamp, the first field in Traefik's default file log format, is at or after the running process's `ExecMainStartTimestamp` counts, so a line left by the process converge restarted does not; a missing start time, a missing line or an unparseable stamp fails the check. It then asserts `NRestarts` is `0`, because with `Restart=always` a crash would otherwise look like a running service. ## Verified - `pre-commit run --files <changed files>` and the commit hooks: passed (ansible-lint, yamllint, reuse, antsibull-changelog-lint, gitleaks); `ansible-test sanity` (pre-push) passed. - `ansible-playbook --syntax-check` on the scenario's converge, prepare and verify playbooks: passed. - Ran the role's `tasks/binary/download.yml` locally against a stand-in built the same way, with a `file://` `traefik_release_url`: download, checksum check and extraction passed, and the extracted stub's `version` output matches `_binary_update`'s version regex. - Ran the ACME wait's shell body against sample logs with `systemctl` stubbed: it passes only for a matching line stamped after the process start, and fails for an older line, no line, a missing log, an unparseable stamp, and an empty or malformed start time. - Two review rounds by a separate agent (argument_specs convention for Jinja defaults, fixture shape vs. `download.yml` and `_binary_update`, NRestarts semantics, systemd ≥ 251 in both molecule images for `--timestamp=unix`, the log format from the role's template). ## Not verified - The Molecule scenario was not run locally; CI runs it. - That this scenario's Traefik logs the ACME failure line in practice: the message and the log format come from the Traefik v3.7.19 source, not from an observed log. If the line never appears, the poll fails loudly after 60 s rather than passing. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added 1 commit 2026-11-27 15:39:46 +00:00
feat(traefik): add traefik_release_url for a release mirror
Build / build (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 0s
Molecule / molecule (pull_request) Canceled after 0s
ab0ce421cc
The archive and checksums URLs were hardcoded to the GitHub releases.
traefik_release_url (default: the GitHub release directory of
traefik_version, as before) lets a host download from a mirror.

The Molecule scenario uses it: verify's update path now downloads
stand-in releases that prepare.yml builds under /opt/molecule-download
(a stub binary answering `version`, its archive and a sha256sum
checksums file), so it no longer fetches two more real releases per
host. The converge still downloads the real release from GitHub, which
keeps the default URL proven. traefik_verify_other_version moves to the
scenario's group vars so prepare and verify share it. The update path
leaves the stub installed, which the README and verify now state.

Verify replaces the fixed 15 s pause with a poll (30 x 2 s) for an
"Unable to obtain ACME certificate" log line stamped at or after the
running process's ExecMainStartTimestamp, so a line left by the
process converge restarted does not count. It fails closed on a
missing start time, a missing line or an unparseable stamp. It then
asserts NRestarts
is 0, since Restart=always would hide a crash.

Assisted-by: Claude Code:claude-opus-5-5
Some required checks failed
Build / build (pull_request) Canceled after 0s
Required
Details
Lint / lint (pull_request) Canceled after 0s
Required
Details
Molecule / molecule (pull_request) Canceled after 0s
Required
Details
Some required checks were not successful.
This pull request is blocked because it's outdated.
You are not authorized to merge this pull request.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/traefik-release-url:feat/traefik-release-url
git checkout feat/traefik-release-url
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#445