Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/swh/deploy/rpc_server.pp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | ::nginx::resource::server {"nginx-swh-${instance_name}": | ||||
server_name => $nginx_server_names, | server_name => $nginx_server_names, | ||||
client_max_body_size => '4G', | client_max_body_size => '4G', | ||||
proxy => "http://swh-${instance_name}-gunicorn", | proxy => "http://swh-${instance_name}-gunicorn", | ||||
proxy_buffering => $nginx_proxy_buffering, | proxy_buffering => $nginx_proxy_buffering, | ||||
proxy_read_timeout => "${backend_http_timeout}s", | proxy_read_timeout => "${backend_http_timeout}s", | ||||
format_log => "combined if=\$error_status", | format_log => "combined if=\$error_status", | ||||
} | } | ||||
$base_env = { | |||||
'SWH_CONFIG_FILENAME' => $conf_file, | |||||
'SWH_LOG_TARGET' => 'journal', | |||||
} | |||||
$sentry_dsn = lookup("swh::deploy::${config_key}::sentry_dsn", Optional[String], 'first', undef) | $sentry_dsn = lookup("swh::deploy::${config_key}::sentry_dsn", Optional[String], 'first', undef) | ||||
$sentry_environment = lookup("swh::deploy::${config_key}::sentry_environment", Optional[String], 'first', undef) | |||||
$env = $sentry_dsn ? { | $sentry_swh_package = lookup("swh::deploy::${config_key}::sentry_swh_package", Optional[String], 'first', undef) | ||||
undef => $base_env, | |||||
default => $base_env + {'SWH_SENTRY_DSN' => $sentry_dsn}, | |||||
} | |||||
::gunicorn::instance {$service_name: | ::gunicorn::instance {$service_name: | ||||
ensure => enabled, | ensure => enabled, | ||||
user => $user, | user => $user, | ||||
group => $group, | group => $group, | ||||
executable => $executable, | executable => $executable, | ||||
config_base_module => $gunicorn_config_base_module, | config_base_module => $gunicorn_config_base_module, | ||||
environment => $env, | environment => { | ||||
'SWH_CONFIG_FILENAME' => $conf_file, | |||||
'SWH_LOG_TARGET' => 'journal', | |||||
'SWH_SENTRY_DSN' => $sentry_dsn, | |||||
'SWH_SENTRY_ENVIRONMENT' => $sentry_environment, | |||||
olasd: same remark wrt quotes/variable expansion | |||||
'SWH_MAIN_PACKAGE' => $sentry_swh_package, | |||||
}, | |||||
settings => { | settings => { | ||||
bind => $gunicorn_unix_socket, | bind => $gunicorn_unix_socket, | ||||
workers => $backend_workers, | workers => $backend_workers, | ||||
worker_class => $gunicorn_worker_class, | worker_class => $gunicorn_worker_class, | ||||
timeout => $backend_http_timeout, | timeout => $backend_http_timeout, | ||||
graceful_timeout => $backend_reload_mercy, | graceful_timeout => $backend_reload_mercy, | ||||
keepalive => $backend_http_keepalive, | keepalive => $backend_http_keepalive, | ||||
max_requests => $backend_max_requests, | max_requests => $backend_max_requests, | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
same remark wrt quotes/variable expansion