Commit f939f3fd by Michael DeHaan

Playbook can now take a 'name' which it will show when starting the play

parent 67d11696
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
# on all hosts, run as the user root... # on all hosts, run as the user root...
- hosts: all - name: example play
hosts: all
user: root user: root
# could have also have done: # could have also have done:
......
...@@ -553,7 +553,8 @@ class PlayBook(object): ...@@ -553,7 +553,8 @@ 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',None)
name = pg.get('name', pattern)
if isinstance(pattern, list): if isinstance(pattern, list):
pattern = ';'.join(pattern) pattern = ';'.join(pattern)
if self.override_hosts: if self.override_hosts:
...@@ -570,7 +571,7 @@ class PlayBook(object): ...@@ -570,7 +571,7 @@ class PlayBook(object):
sudo = pg.get('sudo', self.sudo) sudo = pg.get('sudo', self.sudo)
transport = pg.get('connection', self.transport) transport = pg.get('connection', self.transport)
self.callbacks.on_play_start(pattern) self.callbacks.on_play_start(name)
# push any variables down to the system # and get facts/ohai/other data back up # push any variables down to the system # and get facts/ohai/other data back up
self._do_setup_step(pattern, vars, user, port, sudo, transport, None) self._do_setup_step(pattern, vars, user, port, sudo, transport, None)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment