[stable-2.5] Don't allow import_tasks to transition to dynamic when file is missing. See #44822 (#44836) (#44854)

* [stable-2.5] Don't allow import_tasks to transition to dynamic when file is missing. See #44822 (#44836)
(cherry picked from commit cd2f66f)

Co-authored-by: Matt Martz <matt@sivel.net>

* Look in task_ds, as we don't have action var in 2.5
pull/45257/head
Matt Martz 6 years ago committed by Matt Davis
parent d89bd2d3c1
commit 5ea238912f

@ -0,0 +1,2 @@
minor_changes:
- import_tasks - Do not allow import_tasks to transition to dynamic if the file is missing (https://github.com/ansible/ansible/issues/44822)

@ -227,7 +227,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
# nested includes, and we want the include order printed correctly # nested includes, and we want the include order printed correctly
display.vv("statically imported: %s" % include_file) display.vv("statically imported: %s" % include_file)
except AnsibleFileNotFound: except AnsibleFileNotFound:
if t.static or \ if 'include' not in task_ds or t.static or \
C.DEFAULT_TASK_INCLUDES_STATIC or \ C.DEFAULT_TASK_INCLUDES_STATIC or \
C.DEFAULT_HANDLER_INCLUDES_STATIC and use_handlers: C.DEFAULT_HANDLER_INCLUDES_STATIC and use_handlers:
raise raise

Loading…
Cancel
Save