Files
puppet-mistral/manifests/wsgi/uwsgi.pp
Thomas Goirand 92ca9b40e2 Add support for mistral_api_uwsgi_config in Debian
This patch is adding the configuration of the number of workers,
threads, and the size of the listen queue in Debian, which uses
uwsgi to run Mistral API. Therefore, this patch adds a new
mistral_api_uwsgi_config provider as well as a new
mistral::wsgi::uwsgi class.

Signed-off-by: Thomas Goirand <zigo@debian.org>
Change-Id: I3e1a7b170c9840b0de83e0eb97c596154790d019
2025-10-03 12:43:32 +00:00

41 lines
935 B
Puppet

#
# Copyright 2025 Thomas Goirand <zigo@debian.org>
#
# Author: Thomas Goirand <zigo@debian.org>
#
# == Class: mistral::wsgi::uwsgi
#
# Configure the UWSGI service for Mistral API.
#
# == Parameters
#
# [*processes*]
# (Optional) Number of processes.
# Defaults to $facts['os_workers'].
#
# [*threads*]
# (Optional) Number of threads.
# Defaults to 1.
#
# [*listen_queue_size*]
# (Optional) Socket listen queue size.
# Defaults to 100
#
class mistral::wsgi::uwsgi (
$processes = $facts['os_workers'],
$threads = 1,
$listen_queue_size = 100,
) {
include mistral::deps
if $facts['os']['name'] != 'Debian' {
warning('This class is only valid for Debian, as other operating systems are not using uwsgi by default.')
}
mistral_api_uwsgi_config {
'uwsgi/processes': value => $processes;
'uwsgi/threads': value => $threads;
'uwsgi/listen': value => $listen_queue_size;
}
}