You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are cases where I want to avoid caching a task. This happens if this task is just a "debug" task, which I don't want ansible-bender to spend a lot of time doing caching for the task. And we don't want to cache it also because I want it to be executed for every run for debugging purpose. Another example is "set_fact" or any kinds of tasks that register a variable. I want to avoid caching for these tasks, because if it is cached and skipped, the variable will not be set which is wrong.
Note that this is different than no-cache or stop-layering, which will stop caching for all following tasks.
I think the implementation is easy (at least from my experiment). Just add a tag like SKIP_CACHE_TAG=skip-cache. And in snapshoter.py, add
if SKIP_CACHE_TAG in getattr(task, "tags", []):
return
into both _maybe_load_from_cache and _snapshot functions. I can also create the MR. Just want to make sure you are ok with this enhancement
The text was updated successfully, but these errors were encountered:
If what you imply is skipping caching of one task and continue further with the caching process: I don't think this is a good idea because one could get inconsistent results easily or even weird errors which won't make sense.
On the other hand, I understand the request and would accept such a pull request with a big fat disclaimer in the docs about the consequences of this behaviour :)
There are cases where I want to avoid caching a task. This happens if this task is just a "debug" task, which I don't want ansible-bender to spend a lot of time doing caching for the task. And we don't want to cache it also because I want it to be executed for every run for debugging purpose. Another example is "set_fact" or any kinds of tasks that register a variable. I want to avoid caching for these tasks, because if it is cached and skipped, the variable will not be set which is wrong.
Note that this is different than
no-cache
orstop-layering
, which will stop caching for all following tasks.I think the implementation is easy (at least from my experiment). Just add a tag like
SKIP_CACHE_TAG=skip-cache
. And insnapshoter.py
, addinto both
_maybe_load_from_cache
and_snapshot
functions. I can also create the MR. Just want to make sure you are ok with this enhancementThe text was updated successfully, but these errors were encountered: