New in version 2.4.
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| app | yes | The app module. A name refers to a WSGI callable that should be found in the specified module. aliases: name | ||
| chdir | no | Chdir to specified directory before apps loading. | ||
| config | no | Path to the gunicorn configuration file. | ||
| pid | no | 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 | no | Switch worker processes to run as this user. | ||
| venv | no | Path to the virtualenv directory. aliases: virtualenv | ||
| worker | no |
| The type of workers to use. The default class (sync) should handle most “normal” types of workloads. |
- name: simple gunicorn run example
gunicorn:
app: 'wsgi'
chdir: '/workspace/example'
- name: run gunicorn on a virtualenv
gunicorn:
app: 'wsgi'
chdir: '/workspace/example'
venv: '/workspace/example/venv'
- name: run gunicorn with a config file
gunicorn:
app: 'wsgi'
chdir: '/workspace/example'
conf: '/workspace/example/gunicorn.cfg'
- name: run gunicorn as ansible user with specified pid and config file
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 Return Values, the following are the fields unique to this module:
| name | description | returned | type | sample |
|---|---|---|---|---|
| gunicorn | process id of gunicorn | changed | string | 1234 |
Note
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/gunicorn_module.html