From de221e6b4b3e5b5d5556b4d174a7338cc268b065 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 14 Aug 2012 20:35:01 -0400 Subject: [PATCH] Add vars to host_vars to prevent some suprises --- lib/ansible/playbook/play.py | 2 ++ lib/ansible/runner/__init__.py | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 550ed5571c..fc74228345 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -224,6 +224,8 @@ class Play(object): self.vars_files = [ self.vars_files ] if (host is not None): + self.playbook.SETUP_CACHE[host].update(self.vars) + inventory = self.playbook.inventory hostrec = inventory.get_host(host) groupz = sorted(inventory.groups_for_host(host), key=lambda g: g.depth) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index e3379644b0..f3e67653ae 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -703,6 +703,7 @@ class Runner(object): module_data = "" is_new_style=False + with open(in_path) as f: module_data = f.read() if module_common.REPLACER in module_data: