Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/swh/deploy/webapp.pp
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | class profile::swh::deploy::webapp { | ||||
file {$production_db_file: | file {$production_db_file: | ||||
ensure => present, | ensure => present, | ||||
owner => $user, | owner => $user, | ||||
group => $group, | group => $group, | ||||
mode => '0664', | mode => '0664', | ||||
} | } | ||||
$base_env = { | |||||
'DJANGO_SETTINGS_MODULE' => 'swh.web.settings.production', | |||||
} | |||||
$sentry_dsn = lookup("swh::deploy::webapp::sentry_dsn", Optional[String], 'first', undef) | $sentry_dsn = lookup("swh::deploy::webapp::sentry_dsn", Optional[String], 'first', undef) | ||||
$sentry_environment = lookup("swh::deploy::webapp::sentry_environment", Optional[String], 'first', undef) | |||||
$env = $sentry_dsn ? { | $sentry_swh_package = lookup("swh::deploy::webapp::sentry_swh_package", Optional[String], 'first', undef) | ||||
undef => $base_env, | |||||
default => $base_env + {'SWH_SENTRY_DSN' => $sentry_dsn}, | |||||
} | |||||
::gunicorn::instance {'swh-webapp': | ::gunicorn::instance {'swh-webapp': | ||||
ensure => enabled, | ensure => enabled, | ||||
user => $user, | user => $user, | ||||
group => $group, | group => $group, | ||||
executable => 'django.core.wsgi:get_wsgi_application()', | executable => 'django.core.wsgi:get_wsgi_application()', | ||||
config_base_module => 'swh.web.gunicorn_config', | config_base_module => 'swh.web.gunicorn_config', | ||||
settings => { | settings => { | ||||
bind => $backend_listen_address, | bind => $backend_listen_address, | ||||
workers => $backend_workers, | workers => $backend_workers, | ||||
worker_class => 'sync', | worker_class => 'sync', | ||||
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, | ||||
}, | }, | ||||
environment => $env, | environment => { | ||||
'DJANGO_SETTINGS_MODULE' => 'swh.web.settings.production', | |||||
'SWH_SENTRY_DSN' => "${sentry_dsn}", | |||||
'SWH_SENTRY_ENVIRONMENT' => "${sentry_environment}", | |||||
olasd: and ditto | |||||
'SWH_MAIN_PACKAGE' => "${sentry_swh_package}", | |||||
}, | |||||
} | } | ||||
include ::profile::apache::common | include ::profile::apache::common | ||||
include ::apache::mod::proxy | include ::apache::mod::proxy | ||||
include ::apache::mod::headers | include ::apache::mod::headers | ||||
::apache::vhost {"${vhost_name}_non-ssl": | ::apache::vhost {"${vhost_name}_non-ssl": | ||||
servername => $vhost_name, | servername => $vhost_name, | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
and ditto