1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #355 from jkleint/devel

Fix YAML hosts list.
This commit is contained in:
Michael DeHaan 2012-05-10 13:48:57 -07:00
commit 5ebe915da3

View file

@ -497,13 +497,13 @@ class PlayBook(object):
''' run a list of tasks for a given pattern, in order ''' ''' run a list of tasks for a given pattern, in order '''
# get configuration information about the pattern # get configuration information about the pattern
pattern = pg.get('hosts',None) pattern = pg.get('hosts')
pattern = utils.template(pattern, self.extra_vars, {})
name = pg.get('name', pattern)
if isinstance(pattern, list):
pattern = ';'.join(pattern)
if pattern is None: if pattern is None:
raise errors.AnsibleError('hosts declaration is required') 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 = self._get_vars(pg, self.basedir)
vars_files = pg.get('vars_files', {}) vars_files = pg.get('vars_files', {})