From 1fb1793c705b5b74738d69e84170c2ec4ad6295f Mon Sep 17 00:00:00 2001 From: giovannisciortino <30353557+giovannisciortino@users.noreply.github.com> Date: Tue, 8 Aug 2017 15:48:39 +0200 Subject: [PATCH] =?UTF-8?q?helpers.py:=20Fixes=20#27334=20include=20empty?= =?UTF-8?q?=20task=20file=20within=20a=20'block'=20dis=E2=80=A6=20(#27811)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * helpers.py: Fixes #27334 include empty task file within a 'block' disables the complete block * include module: added warning if file without tasks is included --- lib/ansible/playbook/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/helpers.py b/lib/ansible/playbook/helpers.py index e3e502341b5..44f12eecef3 100644 --- a/lib/ansible/playbook/helpers.py +++ b/lib/ansible/playbook/helpers.py @@ -207,7 +207,8 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h try: data = loader.load_from_file(include_file) if data is None: - return [] + display.warning('file %s is empty and had no tasks to include' % include_file) + continue elif not isinstance(data, list): raise AnsibleParserError("included task files must contain a list of tasks", obj=data)