From 498c27d09a5b8682a88fe1801050ba7355f1e561 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Thu, 22 Oct 2015 11:06:47 -0400 Subject: [PATCH] Re-adding role_names magic variable Fixes #12863 --- lib/ansible/vars/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index a3c2e83245..b84747a49a 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -347,6 +347,9 @@ class VariableManager: variables['hostvars'] = hostvars variables['vars'] = hostvars[host.get_name()] + if play: + variables['role_names'] = [r._role_name for r in play.roles] + if task: if task._role: variables['role_path'] = task._role._role_path