mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
more resilient errors for bad host declarations in play
should fix #10148
This commit is contained in:
@@ -128,7 +128,11 @@ class Play(object):
|
|||||||
if hosts is None:
|
if hosts is None:
|
||||||
raise errors.AnsibleError('hosts declaration is required')
|
raise errors.AnsibleError('hosts declaration is required')
|
||||||
elif isinstance(hosts, list):
|
elif isinstance(hosts, list):
|
||||||
|
try:
|
||||||
hosts = ';'.join(hosts)
|
hosts = ';'.join(hosts)
|
||||||
|
except TypeError,e:
|
||||||
|
raise errors.AnsibleError('improper host declaration: %s' % str(e))
|
||||||
|
|
||||||
self.serial = str(ds.get('serial', 0))
|
self.serial = str(ds.get('serial', 0))
|
||||||
self.hosts = hosts
|
self.hosts = hosts
|
||||||
self.name = ds.get('name', self.hosts)
|
self.name = ds.get('name', self.hosts)
|
||||||
|
|||||||
Reference in New Issue
Block a user