Re-adding role_names magic variable

Fixes #12863
This commit is contained in:
James Cammarata 2015-10-22 11:06:47 -04:00
parent 404ded2b03
commit 498c27d09a

View file

@ -347,6 +347,9 @@ class VariableManager:
variables['hostvars'] = hostvars variables['hostvars'] = hostvars
variables['vars'] = hostvars[host.get_name()] variables['vars'] = hostvars[host.get_name()]
if play:
variables['role_names'] = [r._role_name for r in play.roles]
if task: if task:
if task._role: if task._role:
variables['role_path'] = task._role._role_path variables['role_path'] = task._role._role_path