Default play names to the hosts the play was run against

Fixes #1030
This commit is contained in:
Akita Noek 2016-02-25 11:23:00 -05:00
parent f7b5e85413
commit 26d11b2fb7

View File

@ -463,6 +463,10 @@ class JobCallbackModule(BaseCallbackModule):
def v2_playbook_on_play_start(self, play):
setattr(self, 'play', play)
# Ansible 2.0.0.2 doesn't default .name to hosts like it did in 1.9.4,
# though that default will likely return in a future version of Ansible.
if not hasattr(play, 'name') or play.name == '':
play.name = ', '.join(play.hosts)
self._log_event('playbook_on_play_start', name=play.name,
pattern=play.hosts)