Catch a missing filename in include_vars

Fixes ansible/ansible-modules-core#4445
This commit is contained in:
James Cammarata 2016-08-17 09:30:14 -05:00
parent 8312df1512
commit 77fe1ac7af

View file

@ -34,6 +34,8 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
source = self._task.args.get('_raw_params')
if source is None:
raise AnsibleError("No filename was specified to include.", self._task._ds)
if self._task._role:
source = self._loader.path_dwim_relative(self._task._role._role_path, 'vars', source)