From 3cbf885079d084b97e72a8060dd333d722e21bc4 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 18 Aug 2012 19:49:49 -0400 Subject: [PATCH] Change the order the setup cache is used to update things, such that the example/playbooks/conditional_part1.yml file works as advertised --- lib/ansible/runner/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 831bd2cdc5..39811bf119 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -448,9 +448,10 @@ class Runner(object): host_variables = self.inventory.get_variables(host) port = host_variables.get('ansible_ssh_port', self.remote_port) - inject = self.setup_cache[host].copy() + inject = {} inject.update(host_variables) inject.update(self.module_vars) + inject.update(self.setup_cache[host]) inject['hostvars'] = self.setup_cache # allow with_items to work in playbooks...