mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Correct role name detection
This commit is contained in:
@@ -286,7 +286,11 @@ class Play(object):
|
||||
if not os.path.isfile(task) and not os.path.isfile(handler) and not os.path.isfile(vars_file) and not os.path.isdir(library):
|
||||
raise errors.AnsibleError("found role at %s, but cannot find %s or %s or %s or %s" % (role_path, task, handler, vars_file, library))
|
||||
if os.path.isfile(task):
|
||||
nt = dict(include=pipes.quote(task), vars=role_vars, default_vars=default_vars, role_name=role['role'])
|
||||
if isinstance(role, dict):
|
||||
role_name = role['role']
|
||||
else:
|
||||
role_name = role
|
||||
nt = dict(include=pipes.quote(task), vars=role_vars, default_vars=default_vars, role_name=role_name)
|
||||
for k in special_keys:
|
||||
if k in special_vars:
|
||||
nt[k] = special_vars[k]
|
||||
|
||||
Reference in New Issue
Block a user