diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index bc033148646..00598088468 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -105,6 +105,8 @@ class Play(Base, Taggable, Become): @staticmethod def load(data, variable_manager=None, loader=None): + if ('name' not in data or data['name'] is None) and 'hosts' in data: + data['name'] = data['hosts'] p = Play() return p.load_data(data, variable_manager=variable_manager, loader=loader)