Ejemplo n.º 1
0
def fetch_role(playbook_path, role_name):
    options = Options()
    options.roles_path = '{playbook_path}/provision/roles'.format(
        playbook_path=playbook_path, )
    if not path.exists(options.roles_path):
        makedirs(options.roles_path)
    galaxy = Galaxy(options)
    role = GalaxyRole(galaxy, role_name, path=options.roles_path)
    role.install()
    dependencies = get_application_dependencies(
        playbook_path,
        role_name,
    )
    for role in dependencies:
        fetch_role(playbook_path, role)
Ejemplo n.º 2
0
def fetch_role(playbook_path, role_name):
    options = Options()
    options.roles_path = '{playbook_path}/provision/roles'.format(
        playbook_path=playbook_path,
    )
    if not path.exists(options.roles_path):
        makedirs(options.roles_path)
    galaxy = Galaxy(options)
    role = GalaxyRole(galaxy, role_name, path=options.roles_path)
    role.install()
    dependencies = get_application_dependencies(
        playbook_path,
        role_name,
    )
    for role in dependencies:
        fetch_role(playbook_path, role)
Ejemplo n.º 3
0
 def _role_to_temp_space(self, role_req):
     role_req_kwargs = RoleRequirement.role_yaml_parse(role_req.strip())
     role_obj = GalaxyRole(self._galaxy, **role_req_kwargs)
     installed = role_obj.install()
     return role_obj, installed
Ejemplo n.º 4
0
def role_to_temp_space(role_req, galaxy):
    role_req_kwargs = RoleRequirement.role_yaml_parse(role_req.strip())
    role_obj = GalaxyRole(galaxy, **role_req_kwargs)
    installed = role_obj.install()
    return role_obj, installed