Don't fallback to using the roles name from the spec unless 'role' is missing

Fixes #15104
This commit is contained in:
James Cammarata 2016-04-04 14:02:05 -04:00
parent 331f6ba52e
commit 3509e9cdd4

View file

@ -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