From e4a546e8bb28c19a5577aaf00fd7c6c522ceadfe Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 17 Jul 2012 18:56:31 -0400 Subject: [PATCH] Make it possible to use variables from 'vars' in the paths to task level include statements. --- lib/ansible/playbook/play.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 0d054fe6e8..e2be4748d6 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -39,7 +39,6 @@ class Play(object): # TODO: more error handling - hosts = ds.get('hosts') if hosts is None: raise errors.AnsibleError('hosts declaration is required') @@ -79,7 +78,6 @@ class Play(object): if self.sudo_user != 'root': self.sudo = True - # ************************************************* @@ -96,7 +94,7 @@ class Play(object): for t in tokens[1:]: (k,v) = t.split("=", 1) task_vars[k]=v - include_file = tokens[0] + include_file = utils.template(tokens[0], task_vars) data = utils.parse_yaml_from_file(utils.path_dwim(self.playbook.basedir, include_file)) elif type(x) == dict: data = [x]