Esempio n. 1
0
def install_restservice():
    utils.set_service_as_cloudify_service(runtime_props)
    rest_service_rpm_source_url = ctx_properties['rest_service_rpm_source_url']

    rest_venv = join(HOME_DIR, 'env')
    agent_dir = join(utils.MANAGER_RESOURCES_HOME, 'cloudify_agent')

    ctx.logger.info('Installing REST Service...')
    utils.set_selinux_permissive()

    utils.copy_notice(SERVICE_NAME)
    utils.mkdir(HOME_DIR)
    utils.mkdir(LOG_DIR)
    utils.chown(utils.CLOUDIFY_USER, utils.CLOUDIFY_GROUP, LOG_DIR)
    utils.mkdir(utils.MANAGER_RESOURCES_HOME)
    utils.mkdir(agent_dir)

    deploy_broker_configuration()
    utils.yum_install(rest_service_rpm_source_url, service_name=SERVICE_NAME)
    _configure_dbus(rest_venv)
    install_optional(rest_venv)
    utils.logrotate(SERVICE_NAME)

    utils.deploy_sudo_command_script(script='/usr/bin/systemctl',
                                     description='Run systemctl')
def install_restservice():
    utils.set_service_as_cloudify_service(runtime_props)
    rest_service_rpm_source_url = ctx_properties['rest_service_rpm_source_url']

    rest_venv = join(HOME_DIR, 'env')
    agent_dir = join(utils.MANAGER_RESOURCES_HOME, 'cloudify_agent')

    ctx.logger.info('Installing REST Service...')
    utils.set_selinux_permissive()

    utils.copy_notice(SERVICE_NAME)
    utils.mkdir(HOME_DIR)
    utils.mkdir(LOG_DIR)
    utils.chown(utils.CLOUDIFY_USER, utils.CLOUDIFY_GROUP, LOG_DIR)
    utils.mkdir(utils.MANAGER_RESOURCES_HOME)
    utils.mkdir(agent_dir)

    runtime_props['rabbitmq_endpoint_ip'] = utils.get_rabbitmq_endpoint_ip()
    runtime_props['broker_cert_path'] = utils.INTERNAL_CA_CERT_PATH
    utils.yum_install(rest_service_rpm_source_url, service_name=SERVICE_NAME)
    _configure_dbus(rest_venv)
    install_optional(rest_venv)
    utils.logrotate(SERVICE_NAME)

    utils.deploy_sudo_command_script(script='/usr/bin/systemctl',
                                     description='Run systemctl')
    utils.deploy_sudo_command_script('set-manager-ssl.py',
                                     'Script for setting manager SSL',
                                     SERVICE_NAME)
    utils.deploy_sudo_command_script(script='/usr/sbin/shutdown',
                                     description='Perform shutdown (reboot)')
def install_restservice():
    utils.set_service_as_cloudify_service(runtime_props)
    rest_service_rpm_source_url = ctx_properties['rest_service_rpm_source_url']

    rest_venv = join(HOME_DIR, 'env')
    agent_dir = join(utils.MANAGER_RESOURCES_HOME, 'cloudify_agent')

    ctx.logger.info('Installing REST Service...')
    utils.set_selinux_permissive()

    utils.copy_notice(SERVICE_NAME)
    utils.mkdir(HOME_DIR)
    utils.mkdir(LOG_DIR)
    utils.chown(utils.CLOUDIFY_USER, utils.CLOUDIFY_GROUP, LOG_DIR)
    utils.mkdir(utils.MANAGER_RESOURCES_HOME)
    utils.mkdir(agent_dir)

    deploy_broker_configuration()
    utils.yum_install(rest_service_rpm_source_url,
                      service_name=SERVICE_NAME)
    _configure_dbus(rest_venv)
    install_optional(rest_venv)
    utils.logrotate(SERVICE_NAME)

    utils.deploy_sudo_command_script(
        script='/usr/bin/systemctl',
        description='Run systemctl'
    )
    utils.deploy_sudo_command_script(
        script='/usr/sbin/shutdown',
        description='Perform shutdown (reboot)'
    )
Esempio n. 4
0
def install_mgmtworker():
    riemann_dir = '/opt/riemann'

    management_worker_rpm_source_url = \
        ctx_properties['management_worker_rpm_source_url']

    runtime_props['rabbitmq_endpoint_ip'] = utils.get_rabbitmq_endpoint_ip()

    # Fix possible injections in json of rabbit credentials
    # See json.org for string spec
    for key in ['rabbitmq_username', 'rabbitmq_password']:
        # We will not escape newlines or other control characters,
        # we will accept them breaking
        # things noisily, e.g. on newlines and backspaces.
        # TODO: add:
        # sed 's/"/\\"/' | sed 's/\\/\\\\/' | sed s-/-\\/- | sed 's/\t/\\t/'
        runtime_props[key] = ctx_properties[key]

    utils.set_service_as_cloudify_service(runtime_props)

    ctx.logger.info('Installing Management Worker...')
    utils.set_selinux_permissive()

    utils.copy_notice(SERVICE_NAME)
    utils.mkdir(HOME_DIR)
    utils.mkdir(join(HOME_DIR, 'config'))
    utils.mkdir(join(HOME_DIR, 'work'))
    utils.mkdir(LOG_DIR)
    utils.mkdir(riemann_dir)

    mgmtworker_venv = join(HOME_DIR, 'env')
    # used to run the sanity check
    runtime_props['python_executable'] = join(mgmtworker_venv, 'bin', 'python')

    # this create the mgmtworker_venv and installs the relevant
    # modules into it.
    utils.yum_install(management_worker_rpm_source_url,
                      service_name=SERVICE_NAME)
    _install_optional(mgmtworker_venv)

    # Add certificate and select port, as applicable
    runtime_props['broker_cert_path'] = utils.INTERNAL_CA_CERT_PATH
    # Use SSL port
    runtime_props['broker_port'] = AMQP_SSL_PORT

    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, HOME_DIR)
    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, LOG_DIR)
    # Changing perms on workdir and venv in case they are put outside homedir
    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, mgmtworker_venv)
    # Prepare riemann dir. We will change the owner to riemann later, but the
    # management worker will still need access to it
    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, riemann_dir)
    utils.chmod('770', riemann_dir)

    ctx.logger.info("Using broker port: {0}".format(
        ctx.instance.runtime_properties['broker_port']))
def install_mgmtworker():
    riemann_dir = '/opt/riemann'

    management_worker_rpm_source_url = \
        ctx_properties['management_worker_rpm_source_url']

    runtime_props['rabbitmq_endpoint_ip'] = utils.get_rabbitmq_endpoint_ip()

    # Fix possible injections in json of rabbit credentials
    # See json.org for string spec
    for key in ['rabbitmq_username', 'rabbitmq_password']:
        # We will not escape newlines or other control characters,
        # we will accept them breaking
        # things noisily, e.g. on newlines and backspaces.
        # TODO: add:
        # sed 's/"/\\"/' | sed 's/\\/\\\\/' | sed s-/-\\/- | sed 's/\t/\\t/'
        runtime_props[key] = ctx_properties[key]

    runtime_props['rabbitmq_ssl_enabled'] = True
    utils.set_service_as_cloudify_service(runtime_props)

    ctx.logger.info('Installing Management Worker...')
    utils.set_selinux_permissive()

    utils.copy_notice(SERVICE_NAME)
    utils.mkdir(HOME_DIR)
    utils.mkdir(join(HOME_DIR, 'config'))
    utils.mkdir(join(HOME_DIR, 'work'))
    utils.mkdir(LOG_DIR)
    utils.mkdir(riemann_dir)

    mgmtworker_venv = join(HOME_DIR, 'env')

    # this create the mgmtworker_venv and installs the relevant
    # modules into it.
    utils.yum_install(management_worker_rpm_source_url,
                      service_name=SERVICE_NAME)
    _install_optional(mgmtworker_venv)

    # Add certificate and select port, as applicable
    runtime_props['broker_cert_path'] = utils.INTERNAL_CERT_PATH
    # Use SSL port
    runtime_props['broker_port'] = AMQP_SSL_PORT

    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, HOME_DIR)
    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, LOG_DIR)
    # Changing perms on workdir and venv in case they are put outside homedir
    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, mgmtworker_venv)
    # Prepare riemann dir. We will change the owner to riemann later, but the
    # management worker will still need access to it
    utils.chown(CLOUDIFY_USER, CLOUDIFY_GROUP, riemann_dir)
    utils.chmod('770', riemann_dir)

    ctx.logger.info("Using broker port: {0}".format(
        ctx.instance.runtime_properties['broker_port']))
Esempio n. 6
0
def install_manager_ip_setter():
    utils.mkdir(MANAGER_IP_SETTER_DIR)
    utils.set_service_as_cloudify_service(runtime_props)
    deploy_utils()
    deploy_sudo_scripts()
    utils.systemd.configure(SERVICE_NAME)
def install_manager_ip_setter():
    utils.mkdir(MANAGER_IP_SETTER_DIR)
    utils.set_service_as_cloudify_service(runtime_props)
    deploy_utils()
    deploy_sudo_scripts()
    utils.systemd.configure(SERVICE_NAME)