mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-04 05:04:22 -07:00
Fix idempotency in apt module (#38858)
* Idempotency fix Only show a change, if we did indeed update the cache. * Apply changes from review feedback
This commit is contained in:
parent
a372142434
commit
3664c74cb8
1 changed files with 4 additions and 2 deletions
|
@ -1019,8 +1019,10 @@ def main():
|
||||||
else:
|
else:
|
||||||
module.fail_json(msg='Failed to update apt cache: %s' % err)
|
module.fail_json(msg='Failed to update apt cache: %s' % err)
|
||||||
cache.open(progress=None)
|
cache.open(progress=None)
|
||||||
|
mtimestamp, post_cache_update_time = get_updated_cache_time()
|
||||||
|
if updated_cache_time != post_cache_update_time:
|
||||||
updated_cache = True
|
updated_cache = True
|
||||||
mtimestamp, updated_cache_time = get_updated_cache_time()
|
updated_cache_time = post_cache_update_time
|
||||||
|
|
||||||
# If there is nothing else to do exit. This will set state as
|
# If there is nothing else to do exit. This will set state as
|
||||||
# changed based on if the cache was updated.
|
# changed based on if the cache was updated.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue