Defined Type: uwsgi::app
- Defined in:
- modules/uwsgi/manifests/app.pp
Summary
Provisions a uWSGI application server instance.Overview
SPDX-License-Identifier: Apache-2.0
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'modules/uwsgi/manifests/app.pp', line 32
define uwsgi::app(
Wmflib::Ensure $ensure = present,
Boolean $enabled = true,
String $service_settings = '--die-on-term',
String $core_limit = '0',
Hash $settings = {},
Array[Uwsgi::Route] $routes = [],
String[1] $systemd_user = 'www-data',
String[1] $systemd_group = 'www-data',
Hash $extra_systemd_opts = {},
Wmflib::Ensure $monitoring = present,
) {
include uwsgi
$basename = regsubst($title, '\W', '-', 'G')
file { "/etc/uwsgi/apps-available/${basename}.ini":
ensure => $ensure,
content => template('uwsgi/app.ini.erb'),
}
$inipath = "/etc/uwsgi/apps-enabled/${basename}.ini"
if $ensure == 'present' and $enabled {
file { $inipath:
ensure => link,
target => "/etc/uwsgi/apps-available/${basename}.ini",
}
base::service_unit { "uwsgi-${title}":
ensure => present,
systemd => systemd_template('uwsgi'),
subscribe => File["/etc/uwsgi/apps-available/${basename}.ini"],
}
nrpe::monitor_service { "uwsgi-${title}":
ensure => $monitoring,
description => "${title} uWSGI web app",
nrpe_command => "/bin/systemctl status uwsgi-${title}",
require => Base::Service_unit["uwsgi-${title}"],
notes_url => "https://wikitech.wikimedia.org/wiki/Monitoring/Services/${title}",
}
} else {
file { $inipath:
ensure => absent,
}
base::service_unit { "uwsgi-${title}": # lint:ignore:wmf_styleguide
ensure => absent,
}
nrpe::monitor_service { "uwsgi-${title}":
ensure => absent,
}
}
}
|