From 4cf0c5550e8d711b6e96af4046311139106e3b19 Mon Sep 17 00:00:00 2001 From: John Kleint Date: Thu, 10 May 2012 15:13:32 -0400 Subject: [PATCH] Fix YAML hosts list. --- lib/ansible/playbook.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/playbook.py b/lib/ansible/playbook.py index b2c1ec9f62..4951f37051 100644 --- a/lib/ansible/playbook.py +++ b/lib/ansible/playbook.py @@ -497,13 +497,13 @@ class PlayBook(object): ''' run a list of tasks for a given pattern, in order ''' # get configuration information about the pattern - pattern = pg.get('hosts',None) - pattern = utils.template(pattern, self.extra_vars, {}) - name = pg.get('name', pattern) - if isinstance(pattern, list): - pattern = ';'.join(pattern) + pattern = pg.get('hosts') if pattern is None: raise errors.AnsibleError('hosts declaration is required') + if isinstance(pattern, list): + pattern = ';'.join(pattern) + pattern = utils.template(pattern, self.extra_vars, {}) + name = pg.get('name', pattern) vars = self._get_vars(pg, self.basedir) vars_files = pg.get('vars_files', {})