feat: refresh the APT cache on distribution-only installs when stale #443
Open
Claude
wants to merge 1 commits from
feat/apt-cache-valid-time into main
pull from: feat/apt-cache-valid-time
merge into: Mortis:main
Mortis:main
Mortis:ci/molecule-shared-config
Mortis:ci/molecule-pipelining
Mortis:feat/traefik-release-url
Mortis:feat/cloudflared-lookup-delay
Mortis:test/tailscale-reuse-debs
Mortis:renovate/git.rkdr.net-mortis-molecule-ubuntu2404-0.x
Mortis:feat/400-skip-upgrade-during-vzdump
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Needs Triage
Maintainer needs to evaluate this issue
Status
Ready for Agent
Fully specified, ready for an AFK agent
Status
Ready for Human
Requires human implementation
Wayfinder
Grilling
Decision ticket resolved in conversation with the maintainer
Wayfinder
Map
Wayfinder map: index of a planning effort and its decision tickets
Wayfinder
Prototype
Decision ticket resolved by reacting to a rough concrete artifact
Wayfinder
Research
Decision ticket resolved by reading outside sources
Wayfinder
Task
Manual work that must happen before a decision can be made
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mortis/Kamino#443
Reference in new issue
Block a user
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 #425
The docker prerequisites (
ca-certificates,curl) and the system_baseline packages install only from the distribution's sources, yet refreshed the APT cache on every run. They now passcache_valid_time: 3600, the value the system_baseline update task and user_management already use, so they refresh only a cache older than an hour.Installs from a role's own APT source (docker's Engine packages, tailscale's package) still refresh on every run. If a run wrote the source line but its refresh failed or was interrupted, the next run within the hour would otherwise see a fresh cache, skip the refresh and find no package. So tailscale, which issue #425 listed, has no change here: its only install follows its own source. The docker and tailscale update entry points are unchanged.
The apt module (ansible-core 2.19) takes the cache age from
/var/lib/apt/periodic/update-success-stamp, else from the mtime of/var/lib/apt/lists.Known risk: a source a consumer adds just before system_baseline (for example with
ansible.builtin.deb822_repository, which does not refresh) is not fetched if the cache is younger than an hour; the system_baseline README now says to refresh the cache first. Likewise, on a host built from an image less than an hour before the run, an empty lists directory looks fresh. The docker and system_baseline Molecule scenarios refresh the cache inprepare.yml.Verified
pre-commiton the changed files): gitleaks, yamllint, ruff format, merge-conflict check, REUSE, antsibull-changelog-lint, ansible-lint, Conventional Commit and the Assisted-by trailer check all pass;ansible-test sanity(pre-push) passed.ansible-playbook --syntax-checkofroles/docker/molecule/default/converge.ymlandroles/system_baseline/molecule/default/converge.yml.get_cache_mtime, lines 1172-1177; refresh check, lines 1399-1402).Not verified
NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.