def configure_keystore()

in cars/v1/apm_tracing/config.py [0:0]


def configure_keystore(config_names, variables, **kwargs):
    logger = logging.getLogger(LOGGER_NAME)
    secret_token = variables.get("apm_secret_token")

    # skip keystore configuration entirely if any of the mandatory params is missing
    if not secret_token:
        logger.warning(
            "Skipping keystore configuration for apm-tracing "
            "as mandatory car-params [`apm_secret_token`] was not supplied",
        )
        return False

    keystore_binary_filename = "elasticsearch-keystore"
    install_root = variables["install_root_path"]
    keystore_binary = resolve_binary(install_root, keystore_binary_filename)
    env = kwargs.get("env")

    if not os.path.isfile(resolve_keystore_config(install_root)):
        create_keystore(install_root, keystore_binary, env)

    add_property_to_keystore(keystore_binary, "telemetry.secret_token", secret_token, env)

    # Success
    return True