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
This commit is contained in:
Will Thames 2014-08-14 11:40:45 +10:00 committed by Michael DeHaan
parent bf3066e650
commit b550cb9bc3

View file

@ -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):