geerlingguy / ansible-role-docker

Ansible Role - Docker
https://galaxy.ansible.com/geerlingguy/docker/
MIT License
1.81k stars 853 forks source link

Update APT cache on first invocation #406

Closed abalage closed 1 year ago

abalage commented 1 year ago

Explicitly call package cache update only on first occurrence.

abalage commented 1 year ago

Fixes #407

stale[bot] commented 1 year ago

This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark pull requests as stale.

abalage commented 1 year ago

Okay I got the things written in that blog, no problem with that. However the fix is just a single line, without breaking anything but solving reported issues. Imho it would be pity not incorporating that. :)

stale[bot] commented 1 year ago

This issue is no longer marked for closure.

geerlingguy commented 1 year ago

This will break idempotence—for my roles, I always manage apt caches at the play level, not at the role level. Otherwise every role I have, I would need to add in update_cache and manage a lifetime for the cache, which I'd rather not do since everyone has a different approach. See: https://github.com/geerlingguy/ansible-role-docker/blob/master/molecule/default/converge.yml#L6-L9

abalage commented 1 year ago

Yes I went down that path too because of the change was not merged when I made the PR. Thanks for the feedback though.