mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
hosts can be list or string
This commit is contained in:
parent
2d56293768
commit
e2d2798a42
1 changed files with 4 additions and 1 deletions
|
@ -106,6 +106,9 @@ class Play(Base, Taggable, Become):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def load(data, variable_manager=None, loader=None):
|
def load(data, variable_manager=None, loader=None):
|
||||||
if ('name' not in data or data['name'] is None) and 'hosts' in data:
|
if ('name' not in data or data['name'] is None) and 'hosts' in data:
|
||||||
|
if isinstance(data['hosts'], list):
|
||||||
|
data['name'] = ','.join(data['hosts'])
|
||||||
|
else:
|
||||||
data['name'] = data['hosts']
|
data['name'] = data['hosts']
|
||||||
p = Play()
|
p = Play()
|
||||||
return p.load_data(data, variable_manager=variable_manager, loader=loader)
|
return p.load_data(data, variable_manager=variable_manager, loader=loader)
|
||||||
|
|
Loading…
Reference in a new issue