diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 0059808846..c354b74549 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -106,7 +106,10 @@ 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'] + if isinstance(data['hosts'], list): + data['name'] = ','.join(data['hosts']) + else: + data['name'] = data['hosts'] p = Play() return p.load_data(data, variable_manager=variable_manager, loader=loader)