From 77fe1ac7af3da55db0a4f85db5e54e8b96553ea8 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 17 Aug 2016 09:30:14 -0500 Subject: [PATCH] Catch a missing filename in include_vars Fixes ansible/ansible-modules-core#4445 --- lib/ansible/plugins/action/include_vars.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/plugins/action/include_vars.py b/lib/ansible/plugins/action/include_vars.py index cada2f53a03..c24ad1ef106 100644 --- a/lib/ansible/plugins/action/include_vars.py +++ b/lib/ansible/plugins/action/include_vars.py @@ -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)