Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.gunicorn.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| app string / required | The app module. A name refers to a WSGI callable that should be found in the specified module. aliases: name | |
| chdir string | Chdir to specified directory before apps loading. | |
| config string | Path to the gunicorn configuration file. | |
| pid string | A filename to use for the PID file. If not set and not found on the configuration file a tmp pid file will be created to check a successful run of gunicorn. | |
| user string | Switch worker processes to run as this user. | |
| venv string | Path to the virtualenv directory. aliases: virtualenv | |
| worker string |
| The type of workers to use. The default class (sync) should handle most "normal" types of workloads. |
Note
- name: Simple gunicorn run example
community.general.gunicorn:
app: 'wsgi'
chdir: '/workspace/example'
- name: Run gunicorn on a virtualenv
community.general.gunicorn:
app: 'wsgi'
chdir: '/workspace/example'
venv: '/workspace/example/venv'
- name: Run gunicorn with a config file
community.general.gunicorn:
app: 'wsgi'
chdir: '/workspace/example'
conf: '/workspace/example/gunicorn.cfg'
- name: Run gunicorn as ansible user with specified pid and config file
community.general.gunicorn:
app: 'wsgi'
chdir: '/workspace/example'
conf: '/workspace/example/gunicorn.cfg'
venv: '/workspace/example/venv'
pid: '/workspace/example/gunicorn.pid'
user: 'ansible'
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| gunicorn string | changed | process id of gunicorn Sample: 1234 |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/gunicorn_module.html