From 94a1c221bc90cddc8ffea55435842473ad851dbd Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 22 Jan 2013 16:56:04 +0100 Subject: [PATCH] Update variable precedence section with current rules --- docsite/rst/playbooks2.rst | 6 +++--- lib/ansible/playbook/play.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docsite/rst/playbooks2.rst b/docsite/rst/playbooks2.rst index b4a9eac4484..b80a97d3541 100644 --- a/docsite/rst/playbooks2.rst +++ b/docsite/rst/playbooks2.rst @@ -777,11 +777,11 @@ to determine which place sets the value of the variable. 1. Variables loaded from YAML files mentioned in 'vars_files' in a playbook. -2. 'vars' as defined in the playbook. +2. facts, whether built in or custom, or variables assigned from the 'register' keyword. -3. facts, whether built in or custom, or variables assigned from the 'register' keyword. +3. variables passed to parameterized task include statements. -4. variables passed to parameterized task include statements. +4. 'vars' as defined in the playbook. 5. Host variables from inventory. diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index f678a15bb78..608691c7129 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -261,8 +261,9 @@ class Play(object): self.vars_files = [ self.vars_files ] if host is not None: - inject = self.playbook.SETUP_CACHE[host].copy() + inject = {} inject.update(self.playbook.inventory.get_variables(host)) + inject.update(self.playbook.SETUP_CACHE[host]) for filename in self.vars_files: