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.
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
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #427
The tailscale
defaultscenario 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.debafter each install. So each of those steps downloads the package again. A newprepare.ymlremoves 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.debagainst 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
test_sequencealready includesprepare.docker-cleanis 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-checkpasses on the scenario's prepare, converge and verify playbooks.pre-commit run --files roles/tailscale/molecule/default/prepare.ymlpasses (yamllint, ansible-lint, REUSE, gitleaks);ansible-test sanity(pre-push) passed.python3 -m unittest discover -s tests/scripts: 273 tests OK.apt-cache policyreads the lists and dpkg status, notarchives/); the role's install, downgrade, update and removal paths still run; the persistedpkgcache.binis rebuilt by apt whenever lists or sources change.Not verified
NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code