A puppet module for installing and managing uwsgi
This module installs and configures uWSGI in Emperor mode.
It can also create and manage uwsgi applications that run under the emperor, which are best defined in hiera.
Just about every option is configurable, so it should work on most distributions by putting together a hiera file.
The main entry point. Simply include uwsgi to accept all the default
parameters. The service file template will, by default, auto-configure itself for
redhat init.d or upstart depending on the service provider.
- 
package_nameThe package name to install. Default: 'uwsgi' - 
package_ensurePackage state. Default: 'installed'If 'absent' or 'purged', then remove the
service_fileandconfig_filealso - 
package_providerThe provider to use to install the package. Default: 'pip' - 
service_nameThe name of the service to run uwsgi. Default: 'uwsgi' - 
service_fileThe location of the service file. Default: '/etc/init/uwsgi.conf' - 
service_templateThe location of the template to generate the service_file. Default: 'uwsgi/uwsgi_upstart.conf.erb' - 
service_ensureThe service state. Default: true - 
service_enableThe service onboot state. Default: true - 
service_providerThe service provider. Default: 'upstart'upstartis required for the defaultservice_file, and works on RedHat 6. Settingservice_providertoredhatwill now deploy the init.d service file, unless you specifically setservice_templateetc.systemdwill create a systemd service on RedHat 7 and Debian 8. - 
manage_service_fileWhether to override the system service file if it exists. Default: true - 
binary_directoryDefault: '/usr/sbin'Directory containing the uwsgi binary. Used by the
systemdservice_provider; not used by theupstartorredhatservice_provider parameter. - 
config_fileThe location of the uwsgi config file. Default: '/etc/uwsgi.ini' - 
log_dirThe location of the uwsgi emperor log. Default: '/var/log/uwsgi/uwsgi-emperor.log' - 
log_rotateWhether or not to deploy a logrotate script. Accepts: 'yes', 'no', 'purge' Default: 'no' - 
app_directoryVassal directory for application config files.RedHat default: '/etc/uwsgi.d' Other default: '/etc/uwsgi/apps-enabled'
 - 
install_pipInstall pip if it's not already installed? Default: true - 
install_python_devInstall python header files if not already installed? Default: true - 
python_pipPackage to be installed for pip Default: 'python-pip' - 
python_devPackage to be installed for python headers Default RedHat: 'python-devel' Default Other: 'python-dev' - 
emperor_optionsExtra options to set in the emperor config file. Default: undef 
Sets up some custom options within the emperor config file:
---
uwsgi::emperor_options:
  vacuum: 'True'
  reload-mercy: 8Don't manage python or pip, and use apt-get to install uwsgi. Don't manage the service file, as it will be provided by the package itself:
---
uwsgi::install_pip: false
uwsgi::install_python_dev: false
uwsgi::package_provider: 'apt'
uwsgi::manage_service_file: falseRemove uwsgi:
---
uwsgi::package_ensure: 'absent'
uwsgi::service_ensure: false
uwsgi::service_enable: false
uwsgi::install_pip: false
uwsgi::install_python_dev: falseResponsible for creating uwsgi applications that run under the uwsgi emperor.
You shouldn't need to use this type directly, as the uwsgi class will
automatically create all applications defined in hiera under the uwsgi::app
key. See the hiera section below for examples.
- 
ensureEnsure the config file exists. Default: 'present' - 
templateThe template used to construct the config file. Default: 'uwsgi/uwsgi_app.ini.erb' - 
uidThe user to run the application as. Required. May be the user name, not just the id. - 
gidThe group to run the application as. Required. May be the group name, not just the id. - 
application_optionsExtra options to set in the application config file - 
environment_variablesExtra environment variabls to set in the application config file 
Configure a django application:
---
uwsgi::app:
  django:
    ensure: 'present'
    uid: 'django'
    gid: 'django'
    application_options:
      chdir: '/path/to/project'
      module: 'mysite.wsgi:application'
      socket: '/tmp/uwsgi_django.sock'
      master: 'True'
      vaccum: 'True'
      max-requests: '5000'
      buffer-size: '32768'
      processes: 4
      threads: 8Configure multiple applications (all yaml files are aggregated using
hiera_hash):
# common.yaml
---
uwsgi::app:
  django_1:
    ensure: 'present'
    uid: 'django'
    gid: 'django'
    application_options:
      chdir: '/path/to/project'
      module: 'mysite.wsgi:application'
      socket: '/tmp/uwsgi_django.sock'
# role_app_server.yaml
---
uwsgi::app:
  django_2:
    ensure: 'present'
    uid: 'django'
    gid: 'django'
    application_options:
      chdir: '/path/to/project2'
      module: 'mysite.wsgi:application'
      socket: '/tmp/uwsgi_django2.sock'Example using hiera to use Debian Jessie APT packages & default file locations
---
classes:
  - uwsgi
uwsgi::package_name:
  - 'uwsgi-emperor'
  - 'uwsgi-plugins-all'
uwsgi::package_provider: 'apt'
uwsgi::service_name: 'uwsgi-emperor'
uwsgi::service_provider: 'debian'
uwsgi::manage_service_file: false
uwsgi::config_file: '/etc/uwsgi-emperor/emperor.ini'
uwsgi::log_dir: '/var/log/uwsgi/emperor.log'
uwsgi::app_directory: '/etc/uwsgi-emperor/vassals'
uwsgi::install_pip: false
uwsgi::install_python_dev: false
uwsgi::socket: undef
uwsgi::pidfile: '/run/uwsgi-emperor.pid'
uwsgi::emperor_options:
  uid: 'www-data'
  gid: 'www-data'
  workers: '2'
  no-orphans: 'true'Contributions will be gratefully accepted. Please go to the project page, fork the project, make your changes locally and then raise a pull request. Details on how to do this are available at https://guides.github.com/activities/contributing-to-open-source.
| Release | PR/Issue/commit | Contributer | 
|---|---|---|
| 1.3.1 | Add systemd support for Debian 8 | @rvdh | 
| 1.3.0 | Add systemd support | @andy-s-clark | 
| 1.3.0 | Make tyrant mode configurable | @TravellingGuy | 
| 1.3.0 | Additional Options | @elmerfud | 
| 1.2.0 | Support repeated application options by passing an array of values | @rayl | 
| 1.1.0 | Fix typo in Upstart script | @Kodapa | 
| 1.1.0 | Support multiple env options | @kimor79 | 
| 1.0.1 | Fix logging when using init.d | @kimor79 | 
| 1.0.0 | init.d support | @kimor79 | 
| 0.9.0 | @jarshwah |