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

Open
Claude wants to merge 1 commits from test/tailscale-reuse-debs into main
pull from: test/tailscale-reuse-debs
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
All checks were successful
Build / build (pull_request) Successful in 23s
Required
Details
Lint / lint (pull_request) Successful in 2m17s
Required
Details
Molecule / molecule (pull_request) Successful in 6m14s
Required
Details
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 test/tailscale-reuse-debs:test/tailscale-reuse-debs
git checkout test/tailscale-reuse-debs
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#440