Default variable details

Some of debops.gunicorn default variables have more extensive configuration than simple strings or lists, here you can find documentation and examples for them.


The gunicorn__applications and gunicorn__dependent_applications lists manage the information about the WSGi-compatible applications served by Gunicorn. Each entry is a YAML dictionary with specific parameters. Most of the parameters are passed directly to the configuration file after some processing.

List of known parameters:

Required. Name of the application server to use, it will be used as the configuration file name in the /etc/gunicorn.d/ directory, as well as the process name.
Optional. Additional comments added to the beginning of the configuration file; can be specified as a string or a YAML text block.
Optional. If not specified or present, the configuration file will be generated. If absent, the configuration file will be removed.

The rest of the parameters specified in a given entry should be dictionary keys with either a string, a YAML list or a YAML dictionary as values. See

Required, string. Path to the working directory of a given application.
Optional, string. Path to the Python executable to use.
Optional, string. What mode to use for the application, usually wsgi or django.
Optional, string. UNIX user account which will be used to run the application processes. If not specified, www-data user account will be used.
Optional, string. UNIX group which will be used to run the application processes. If not specified, www-data group will be used.
Optional. YAML dictionary with environment variables to set for a given application. Each dictionary key should be the variable name, and dictionary value will be its value.
Required. YAML list of arguments to pass to the gunicorn daemon.


# Manage Green Unicorn applications

  # Deploy a system-wide WSGI application
  - name: 'system-app'
    working_dir: '/path/to/deploy/dir'
    user: 'worker-user'
    group: 'worker-group'
    args: [ '--bind=',
            '--workers={{ ansible_processor_vcpus|int + 1 }}',
            '--timeout=10' 'system-app.wsgi' ]

  # Deploy a virtualenv WSGI application (requires gunicorn of the same version
  # to be installed inside the virtualenv)
  - name: 'virtualenv-app'
    comment: 'This application is deployed in a virtualenv'
    working_dir: '/path/to/virtualenv/app/src'
    python: '/path/to/virtualenv/bin/python'
    mode: 'wsgi'
    user: 'custom-user'
    group: 'custom-group'
    args: [ '--bind=unix:/run/gunicorn/virtualenv-app.sock',
            '--workers={{ ansible_processor_vcpus|int + 1 }}',
            '--timeout=10' 'virtualenv-app.wsgi' ]

  # Remove an old application configuration
  - name: 'old-app'
    state: 'absent'