test(tailscale): let apt reuse downloaded packages in the default scenario #440

Merged
Defame1297 merged 2 commits from test/tailscale-reuse-debs into main 2026-11-27 19:00:33 +00:00
Owner

What and why

Closes #427

The tailscale default scenario installs tailscale from pkgs.tailscale.com in converge, then downgrades, updates and reinstalls it in verify. The Ubuntu base image of both molecule images ships /etc/apt/apt.conf.d/docker-clean, which deletes every downloaded .deb after each install. So each of those steps downloads the package again. A new prepare.yml removes that file so apt reuses the cached .debs. The real install from the repository stays, because verify asserts the package comes from there. apt still checks a cached .deb against the repository's hashes before installing it. Estimated effect: about 5 tailscale downloads per host drop to 2 (the candidate and the older version). This is an estimate, not a measurement.

Verified

  • The scenario's test_sequence already includes prepare.
  • docker-clean is present in the root layer of both pinned base images (ubuntu:24.04 and ubuntu:26.04), and neither molecule Dockerfile removes it.
  • ansible-playbook --syntax-check passes on the scenario's prepare, converge and verify playbooks.
  • pre-commit run --files roles/tailscale/molecule/default/prepare.yml passes (yamllint, ansible-lint, REUSE, gitleaks); ansible-test sanity (pre-push) passed.
  • python3 -m unittest discover -s tests/scripts: 273 tests OK.
  • Reviewed by a separate agent: no assertion depends on a re-download or an empty cache (apt-cache policy reads the lists and dpkg status, not archives/); the role's install, downgrade, update and removal paths still run; the persisted pkgcache.bin is rebuilt by apt whenever lists or sources change.

Not verified

  • The Molecule run itself (CI only), so the reduction in downloads is not measured.

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

Assisted-by: Claude Code

## What and why Closes #427 The tailscale `default` scenario installs tailscale from pkgs.tailscale.com in converge, then downgrades, updates and reinstalls it in verify. The Ubuntu base image of both molecule images ships `/etc/apt/apt.conf.d/docker-clean`, which deletes every downloaded `.deb` after each install. So each of those steps downloads the package again. A new `prepare.yml` removes that file so apt reuses the cached `.deb`s. The real install from the repository stays, because verify asserts the package comes from there. apt still checks a cached `.deb` against the repository's hashes before installing it. Estimated effect: about 5 tailscale downloads per host drop to 2 (the candidate and the older version). This is an estimate, not a measurement. ## Verified - The scenario's `test_sequence` already includes `prepare`. - `docker-clean` is present in the root layer of both pinned base images (ubuntu:24.04 and ubuntu:26.04), and neither molecule Dockerfile removes it. - `ansible-playbook --syntax-check` passes on the scenario's prepare, converge and verify playbooks. - `pre-commit run --files roles/tailscale/molecule/default/prepare.yml` passes (yamllint, ansible-lint, REUSE, gitleaks); `ansible-test sanity` (pre-push) passed. - `python3 -m unittest discover -s tests/scripts`: 273 tests OK. - Reviewed by a separate agent: no assertion depends on a re-download or an empty cache (`apt-cache policy` reads the lists and dpkg status, not `archives/`); the role's install, downgrade, update and removal paths still run; the persisted `pkgcache.bin` is rebuilt by apt whenever lists or sources change. ## Not verified - The Molecule run itself (CI only), so the reduction in downloads is not measured. --- - [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 14:44:50 +00:00
test(tailscale): let apt reuse downloaded packages in the default scenario
Build / build (pull_request) Successful in 23s
Lint / lint (pull_request) Successful in 2m17s
Molecule / molecule (pull_request) Successful in 6m14s
0eade70b56
The Ubuntu base image's /etc/apt/apt.conf.d/docker-clean deletes every
downloaded .deb after an install, so verify's downgrade, update and
reinstalls fetched tailscale from pkgs.tailscale.com again each time. A
prepare playbook removes it; the install from the real repository stays,
and apt still checks a cached .deb against the repository's hashes.

Assisted-by: Claude Code:claude-opus-5-5
Defame1297 added 1 commit 2026-11-27 18:56:42 +00:00
Merge branch 'main' into test/tailscale-reuse-debs
Build / build (pull_request) Successful in 37s
Lint / lint (pull_request) Successful in 2m24s
Molecule / molecule (pull_request) Successful in 2m47s
a5c1426b25
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-27 18:56:58 +00:00
Defame1297 approved these changes 2026-11-27 18:57:55 +00:00
Defame1297 merged commit 90f27812eb into main 2026-11-27 19:00:33 +00:00
Defame1297 deleted branch test/tailscale-reuse-debs 2026-11-27 19:00:42 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#440