Skip to content

Commit

Permalink
Ignore include_role and include_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
ZXCroon committed Jun 3, 2021
1 parent 7bf8ca5 commit 003a3cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ansible_bender/callback_plugins/snapshoter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ def _snapshot(self, task_result):
:param task_result: instance of TaskResult
"""
if task_result._task.action in ["setup", "gather_facts"]:
if task_result._task.action in ["setup", "gather_facts", "include_role", "include_tasks"]:
# we ignore setup
# for include_role and include_tasks
# ignore the parsing task and only cache following tasks in included file
return
if task_result.is_failed() or task_result._result.get("rc", 0) > 0:
return
Expand Down Expand Up @@ -165,8 +167,10 @@ def _maybe_load_from_cache(self, task):
:param task: instance of Task
"""
if task.action in ["setup", "gather_facts"]:
if task.action in ["setup", "gather_facts", "include_role", "include_tasks"]:
# we ignore setup
# for include_role and include_tasks
# ignore the parsing task and only cache following tasks in included file
return
a, build = self._get_app_and_build()
if build.is_failed():
Expand Down

0 comments on commit 003a3cc

Please sign in to comment.