fix(ansible): download the archive of the pinned version - #151
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
問題
Renovateが
ansible/vars/versions.yamlのversionを上げた後にplaybookを実行しても、difft/act/ghqが古いversionのままだった。version stampだけが新しいversionに更新されるため、次回以降はinstall block自体がskipされ、永久に古いままになる。原因
ansible.builtin.get_urlはdefaultがforce: falseで、dest が既に存在する場合はdownloadをskipする(同じdestに対するlast-modified比較のみで、URLが変わったかどうかは見ない)。destが/tmp/difftastic.tar.gzのようにversionに依存しない固定名だったため、前回のrunで落とした古いarchiveがそのまま再展開されていた。aptmoduleのdeb:でinstallしているlsd / btm / wezterm は、moduleが毎回自分で一時fileにdownloadするのでこの問題は起きない。影響を受けるのはget_urlを使う difft / act / ghq とMoralerspace fontの4箇所。修正
destのfile名にversionを含めて、別versionは別fileになるようにした。
確認
手元で古いarchiveを
/tmpに残したまま実行し、修正後は正しく更新されることを確認した。2回目の実行は
changed=0 skipped=3で冪等。🤖 Generated with Claude Code
https://claude.ai/code/session_018aVdWSLTWB8VmHUBKgBVcN