From 083aef65ade1f7448ce98f8afaf70b797eead83d Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Fri, 11 Sep 2015 01:14:06 -0400 Subject: [PATCH] Revert "set_fact should put facts in the fact_cache, not vars_cache" This reverts commit 926f127245ee2870f862ee20ec6aead827d0786f. --- lib/ansible/executor/process/result.py | 2 +- lib/ansible/plugins/action/template.py | 23 +---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/lib/ansible/executor/process/result.py b/lib/ansible/executor/process/result.py index 26ecc2a6403..3bc3530f1f3 100644 --- a/lib/ansible/executor/process/result.py +++ b/lib/ansible/executor/process/result.py @@ -158,7 +158,7 @@ class ResultProcess(multiprocessing.Process): elif 'ansible_facts' in result_item: # if this task is registering facts, do that now item = result_item.get('item', None) - if result._task.action == 'include_vars': + if result._task.action in ('set_fact', 'include_vars'): for (key, value) in iteritems(result_item['ansible_facts']): self._send_result(('set_host_var', result._host, result._task, item, key, value)) else: diff --git a/lib/ansible/plugins/action/template.py b/lib/ansible/plugins/action/template.py index 7b1e3976042..6f24fb9c1cc 100644 --- a/lib/ansible/plugins/action/template.py +++ b/lib/ansible/plugins/action/template.py @@ -68,28 +68,7 @@ class ActionModule(ActionBase): if source is None: return dict(failed=True, msg="could not find src in first_available_file list") else: - if self._task._task_include is not None: - parent_include = self._task._task_include - while parent_include is not None: - parent_include_dir = self._templar.template(os.path.dirname(parent_include.args.get('_raw_params'))) - while parent_include_dir: - if self._task._role: - new_basedir = os.path.join(self._task._role._role_path, 'tasks', parent_include_dir) - source = self._loader.path_dwim_relative(new_basedir, 'tasks', source) - else: - new_basedir = os.path.join(self._loader.get_basedir(), parent_include_dir) - source = self._loader.path_dwim_relative(new_basedir, 'templates', os.path.basename(source)) - - if os.path.exists(source): - break - else: - parent_include_dir = os.path.dirname(parent_include_dir) - - if os.path.exists(source): - break - else: - parent_include = parent_include._task_include - elif self._task._role is not None: + if self._task._role is not None: source = self._loader.path_dwim_relative(self._task._role._role_path, 'templates', source) else: source = self._loader.path_dwim_relative(self._loader.get_basedir(), 'templates', source)