예제 #1
0
파일: provision.py 프로젝트: mlrdk/backend
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)
예제 #2
0
파일: provision.py 프로젝트: mlrdk/backend
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)
예제 #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
예제 #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