Skip to content

Commit

Permalink
Merge pull request #53 from caktus/force-gunicorn-version-to-be-in-re…
Browse files Browse the repository at this point in the history
…quirements

Force gunicorn version to specified along with other requirements
  • Loading branch information
vkurup authored Feb 24, 2020
2 parents fbf43f6 + 7cc2e47 commit fd0076a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Tequila-django

Changes

v 0.9.28 on Feb 24, 2020
------------------------
* Remove support for ``gunicorn_version``. Instead, projects should pin the specific
gunicorn version that they want to use in their requirements.txt file.

v 0.9.27 on Oct 17, 2019
------------------------
* Allow overriding the default supervisor version.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2019, Caktus Consulting Group, LLC
Copyright (c) 2016-2020, Caktus Consulting Group, LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ The following variables are used by the ``tequila-django`` role:
`New Relic APM <https://pypi.org/project/newrelic/>`_, e.g. ``"4.14.0.115"``
- ``supervisor_version`` **default:** ``"3.0"``
- ``cloud_staticfiles`` **default:** ``false``
- ``gunicorn_version`` **optional**
- ``gunicorn_num_workers`` **required**
- ``gunicorn_num_threads`` **optional** (note: gunicorn sets this at ``1`` if ``--threads=...`` is not given)
- ``project_user`` **default:** ``"{{ project_name }}"``
Expand Down
23 changes: 14 additions & 9 deletions tasks/web-gunicorn.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
---
- name: install gunicorn
pip:
name: gunicorn
state: present
version: "{{ gunicorn_version|default(omit) }}"
virtualenv: "{{ venv_dir }}"
virtualenv_python: /usr/bin/python{{ python_version }}
- name: halt if gunicorn_version is set
assert:
that: gunicorn_version is not defined
fail_msg: "gunicorn_version is no longer supported. Remove it from your Ansible variables and instead pin `gunicorn==x.y` in your project's requirements"

- name: ensure that gunicorn is present in the virtualenv
command: "{{ venv_dir }}/bin/pip show gunicorn"
become_user: "{{ project_user }}"
vars:
ansible_ssh_pipelining: true
ignore_errors: True
register: result

- name: warn if gunicorn is not installed
fail:
msg: please specify gunicorn in your project's requirements file
when: result is failed

- name: configure gunicorn
template:
Expand Down

0 comments on commit fd0076a

Please sign in to comment.