Skip to content

fix(ansible): download the archive of the pinned version - #151

Merged
soblin merged 1 commit into
mainfrom
fix/stale-download-cache
Aug 21, 2026
Merged

soblin merged 1 commit into
mainfrom
fix/stale-download-cache

Conversation

@soblin

@soblin soblin commented Aug 21, 2026

Copy link
Copy Markdown
Owner

問題

Renovateが ansible/vars/versions.yaml のversionを上げた後にplaybookを実行しても、difft / act / ghq が古いversionのままだった。version stampだけが新しいversionに更新されるため、次回以降はinstall block自体がskipされ、永久に古いままになる。

stamp: difft=0.70.0  act=v0.2.89  ghq=v1.10.1
実体:  difft 0.67.0   act 0.2.84   ghq 1.8.0

原因

ansible.builtin.get_url はdefaultが force: false で、dest が既に存在する場合はdownloadをskipする(同じdestに対するlast-modified比較のみで、URLが変わったかどうかは見ない)。destが /tmp/difftastic.tar.gz のようにversionに依存しない固定名だったため、前回のrunで落とした古いarchiveがそのまま再展開されていた。

apt moduleの deb: でinstallしているlsd / btm / wezterm は、moduleが毎回自分で一時fileにdownloadするのでこの問題は起きない。影響を受けるのは get_url を使う difft / act / ghq とMoralerspace fontの4箇所。

修正

destのfile名にversionを含めて、別versionは別fileになるようにした。

確認

手元で古いarchiveを /tmp に残したまま実行し、修正後は正しく更新されることを確認した。

Difftastic 0.70.0
act version 0.2.89
ghq version 1.10.1

2回目の実行は changed=0 skipped=3 で冪等。

🤖 Generated with Claude Code

https://claude.ai/code/session_018aVdWSLTWB8VmHUBKgBVcN

get_url does not re-download when dest already exists, so a stale
archive left in /tmp by a previous run was unarchived again after a
version bump. The command stayed at the old version while the version
stamp was updated to the new one.

Put the version in the dest file name so that a different version is
always a different file.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018aVdWSLTWB8VmHUBKgBVcN
@soblin
soblin merged commit 4af1da5 into main Aug 21, 2026
6 checks passed
@soblin
soblin deleted the fix/stale-download-cache branch August 21, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant