diff --git a/lib/ansible/playbook/role/requirement.py b/lib/ansible/playbook/role/requirement.py index a37e65fcea2..e41b6c37f9a 100644 --- a/lib/ansible/playbook/role/requirement.py +++ b/lib/ansible/playbook/role/requirement.py @@ -83,8 +83,7 @@ class RoleRequirement(RoleDefinition): # 'version': 'v1.0', # 'name': 'repo' # } - - display.deprecated("The comma separated role spec format, use the yaml/explicit format instead.") + display.deprecated("The comma separated role spec format, use the yaml/explicit format instead. Line that trigger this: %s" % role_spec) default_role_versions = dict(git='master', hg='tip') @@ -145,8 +144,13 @@ class RoleRequirement(RoleDefinition): return dict(name=name, src=src, scm=scm, version=version) if 'role' in role: - # Old style: {role: "galaxy.role,version,name", other_vars: "here" } - role = RoleRequirement.role_spec_parse(role['role']) + name = role['role'] + if ',' in name: + # Old style: {role: "galaxy.role,version,name", other_vars: "here" } + role = RoleRequirement.role_spec_parse(role['role']) + else: + del role['role'] + role['name'] = name else: role = role.copy()