Commit 321b0b87 by Matjaz Gregoric Committed by Edward Zarecor

Add ability to specify custom python requirements.

This lets you specify additional python packages to be installed
into the edxapp virtual environment.

The `EDXAPP_EXTRA_REQUIREMENTS` should be a list of dict objects
with `name`, `version` (optional) and `extra_args` (optional) keys,
that correspond to the options of ansible's pip module.

Example:

    EDXAPP_EXTRA_REQUIREMENTS:
      - name: mypackage
        version: 1.0.1
      - name: git+https://git.myproject.org/MyProject#egg=MyProject
parent 1f6f5bec
......@@ -254,6 +254,17 @@ EDXAPP_UPDATE_STATIC_FILES_KEY: false
EDXAPP_INSTALL_PRIVATE_REQUIREMENTS: false
# List of additional python packages that should be installed into the
# edxapp virtual environment.
# `name` (required), `version` (optional), and `extra_args` (optional)
# are supported and correspond to the options of ansible's pip module.
# Example:
# EDXAPP_EXTRA_REQUIREMENTS:
# - name: mypackage
# version: 1.0.1
# - name: git+https://git.myproject.org/MyProject#egg=MyProject
EDXAPP_EXTRA_REQUIREMENTS: []
EDXAPP_GOOGLE_ANALYTICS_ACCOUNT: "None"
EDXAPP_PEARSON_TEST_PASSWORD: ""
......
......@@ -252,6 +252,20 @@
- "restart edxapp"
- "restart edxapp_workers"
# Install any custom extra requirements if defined in EDXAPP_EXTRA_REQUIREMENTS.
- name: install python extra requirements
pip: >
name="{{ item.name }}"
{% if 'version' in item %}version="{{ item.version }}"{% endif %}
extra_args="--exists-action w --use-mirrors {{ item.extra_args|default('') }}"
virtualenv="{{ edxapp_venv_dir }}"
state=present
with_items: EDXAPP_EXTRA_REQUIREMENTS
sudo_user: "{{ edxapp_user }}"
notify:
- "restart edxapp"
- "restart edxapp_workers"
# If using CAS and you have a function for mapping attributes, install
# the module here. The next few tasks set up the python code sandbox
- name: install CAS attribute module
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment