From 7051cdeb57d947a213803ca28a4e1a6a2f905d26 Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Thu, 21 Aug 2014 11:56:27 +0200 Subject: [PATCH] roles: make role_path (path of current role) available as variable to the task --- lib/ansible/playbook/play.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 5187ef07ee4..d37086c14ef 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -373,10 +373,12 @@ class Play(object): roles = self._build_role_dependencies(roles, [], self.vars) - # give each role an uuid + # give each role an uuid and + # make role_path available as variable to the task for idx, val in enumerate(roles): this_uuid = str(uuid.uuid4()) roles[idx][-2]['role_uuid'] = this_uuid + roles[idx][-2]['role_path'] = roles[idx][1] role_names = []