Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/swh/deploy/webapp.pp
Show All 33 Lines | class profile::swh::deploy::webapp { | ||||
$vhost_port = lookup('apache::http_port') | $vhost_port = lookup('apache::http_port') | ||||
$vhost_docroot = "/var/www/${vhost_name}" | $vhost_docroot = "/var/www/${vhost_name}" | ||||
$vhost_basic_auth_file = "${conf_directory}/http_auth" | $vhost_basic_auth_file = "${conf_directory}/http_auth" | ||||
$vhost_basic_auth_content = lookup('swh::deploy::webapp::vhost::basic_auth_content', String, 'first', '') | $vhost_basic_auth_content = lookup('swh::deploy::webapp::vhost::basic_auth_content', String, 'first', '') | ||||
# Note that it's required by the ::profile::swh::deploy::webapp::icinga_checks | # Note that it's required by the ::profile::swh::deploy::webapp::icinga_checks | ||||
$vhost_ssl_port = lookup('apache::https_port') | $vhost_ssl_port = lookup('apache::https_port') | ||||
$production_db_dir = lookup('swh::deploy::webapp::production_db_dir') | |||||
$production_db_file = lookup('swh::deploy::webapp::production_db') | |||||
$locked_endpoints = lookup('swh::deploy::webapp::locked_endpoints', Array, 'unique') | $locked_endpoints = lookup('swh::deploy::webapp::locked_endpoints', Array, 'unique') | ||||
$endpoint_directories = $locked_endpoints.map |$endpoint| { | $endpoint_directories = $locked_endpoints.map |$endpoint| { | ||||
{ path => "^${endpoint}", | { path => "^${endpoint}", | ||||
provider => 'locationmatch', | provider => 'locationmatch', | ||||
auth_type => 'Basic', | auth_type => 'Basic', | ||||
auth_name => 'Software Heritage development', | auth_name => 'Software Heritage development', | ||||
auth_user_file => $vhost_basic_auth_file, | auth_user_file => $vhost_basic_auth_file, | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | file {$conf_file: | ||||
notify => Service['gunicorn-swh-webapp'], | notify => Service['gunicorn-swh-webapp'], | ||||
} | } | ||||
$storage_cfg = $full_webapp_config['storage'] | $storage_cfg = $full_webapp_config['storage'] | ||||
if $storage_cfg['cls'] == 'cassandra' { | if $storage_cfg['cls'] == 'cassandra' { | ||||
include ::profile::swh::deploy::storage_cassandra | include ::profile::swh::deploy::storage_cassandra | ||||
} | } | ||||
file {$production_db_dir: | |||||
ensure => directory, | |||||
owner => $user, | |||||
group => $group, | |||||
mode => '0755', | |||||
} | |||||
file {$production_db_file: | |||||
ensure => present, | |||||
owner => $user, | |||||
group => $group, | |||||
mode => '0664', | |||||
} | |||||
$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) | $sentry_environment = lookup('swh::deploy::webapp::sentry_environment', Optional[String], 'first', undef) | ||||
$sentry_swh_package = lookup('swh::deploy::webapp::sentry_swh_package', Optional[String], 'first', undef) | $sentry_swh_package = lookup('swh::deploy::webapp::sentry_swh_package', Optional[String], 'first', undef) | ||||
::gunicorn::instance {'swh-webapp': | ::gunicorn::instance {'swh-webapp': | ||||
ensure => enabled, | ensure => enabled, | ||||
user => $user, | user => $user, | ||||
group => $group, | group => $group, | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |