예제 #1
0
def _install_service(service_kwargs, platform=None, user_account=None):
    if serviceinstaller is None:
        raise ModuleNotFoundError("Serviceinstaller must be installed.")
    if user_account is not None:
        service_kwargs = copy.deepcopy(service_kwargs)
        service_kwargs["service_settings"]["Service"]["User"] = user_account
    serviceinstaller.install_service(**service_kwargs, platform=platform)
예제 #2
0
def install_sindri_service(platform=None, verbose=None):
    log_setup(verbose)

    serviceinstaller.install_service(
        sindri.config.service.SERVICE_DEFAULTS,
        service_filename=sindri.config.service.SERVICE_FILENAME,
        services_enable=sindri.config.service.SERVICES_ENABLE,
        services_disable=sindri.config.service.SERVICES_DISABLE,
        platform=platform,
    )
예제 #3
0
def install_autossh(skip_package_install=False, platform=None):
    # pylint: disable=import-outside-toplevel
    from brokkr.config.main import CONFIG
    if serviceinstaller is None:
        raise ModuleNotFoundError("Serviceinstaller must be installed.")
    if not CONFIG["autossh"]["server_hostname"]:
        raise RuntimeError(
            "Cannot install autossh: Hostname not provided in config. "
            "Run 'brokkr configure-system' to set the system config path, "
            "and ensure a value is preset for at least the "
            "'server_hostname' key in the main config's 'autossh' section.")

    if not skip_package_install:
        install_succeeded = _install_distro_package("autossh")
        if not install_succeeded:
            return install_succeeded

    serviceinstaller.install_service(
        **brokkr.utils.services.AUTOSSH_SERVICE_KWARGS, platform=platform)
    return True
예제 #4
0
def install_service(platform=None):
    if serviceinstaller is None:
        raise ModuleNotFoundError("Serviceinstaller must be installed.")
    serviceinstaller.install_service(
        **brokkr.utils.services.BROKKR_SERVICE_KWARGS, platform=platform)