From b550cb9bc36b966f223383e484debfda8a1c9b44 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Thu, 14 Aug 2014 11:40:45 +1000 Subject: [PATCH] Need to take URLs into account when running playbooks too Ensure that if meta/main.yml has dependencies containing URLs these are correctly resolved at playbook runtime. Update role_name during run time so that output of e.g. task names look sensible --- lib/ansible/playbook/play.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index d37086c14e..bf27bfc857 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -178,6 +178,10 @@ class Play(object): returns any variables that were included with the role """ orig_path = template(self.basedir,role,self.vars) + if '+' in orig_path and '://' in orig_path: + # dependency name pointing to SCM URL + # assume role name is last part of the URL + orig_path = orig_path.split('/')[-1] role_vars = {} if type(orig_path) == dict: @@ -412,6 +416,8 @@ class Play(object): role_name = role['role'] else: role_name = role + if '+' in role_name and '://' in role_name: + role_name = role_name.split('/')[-1] role_names.append(role_name) if os.path.isfile(task):