Don't fallback to using the roles name from the spec unless 'role' is missing
Fixes #15104
This commit is contained in:
parent
331f6ba52e
commit
3509e9cdd4
1 changed files with 2 additions and 1 deletions
|
@ -213,7 +213,8 @@ class Play(object):
|
|||
role_vars = {}
|
||||
if type(orig_path) == dict:
|
||||
# what, not a path?
|
||||
role_name = utils.role_yaml_parse(orig_path)["name"]
|
||||
parsed_role = utils.role_yaml_parse(orig_path)
|
||||
role_name = parsed_role.get('role', parsed_role.get('name'))
|
||||
if role_name is None:
|
||||
raise errors.AnsibleError("expected a role name in dictionary: %s" % orig_path)
|
||||
role_vars = orig_path
|
||||
|
|
Loading…
Reference in a new issue