Skip to content

Commit eb1724e

Browse files
authored
Merge pull request #281 from StackStorm/feature/pip-install
Ability to install addition pip modules into the st2 virtualenv
2 parents e6cad37 + f9de59f commit eb1724e

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Below is the list of variables you can redefine in your playbook to customize st
4646
| `st2_auth_password` | `testp` | Password used by StackStorm standalone authentication.
4747
| `st2_save_credentials` | `yes` | Save credentials for local CLI in `/root/.st2/config` file.
4848
| `st2_packs` | `[ st2 ]` | List of packs to install. This flag does not work with a `--python3` only pack.
49+
| `st2_python_packages` | `[ ]` | List of python packages to install into the `/opt/stackstorm/st2` virtualenv. This is needed when deploying alternative auth or coordination backends which depend on Python modules to make them work.
4950
| **st2web**
5051
| `st2web_ssl_certificate` | `null` | String with custom SSL certificate (`.crt`). If not provided, self-signed certificate will be generated.
5152
| `st2web_ssl_certificate_key` | `null` | String with custom SSL certificate secret key (`.key`). If not provided, self-signed certificate will be generated.

roles/StackStorm.st2/defaults/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ st2_save_credentials: yes
3737
# ST2 packs to be installed (list)
3838
st2_packs:
3939
- st2
40+
41+
# Additional python packages to install
42+
st2_python_packages: []

roles/StackStorm.st2/tasks/main.yml

+15
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@
8484
- reload st2
8585
tags: st2
8686

87+
- name: Install additional Python packages into the st2 virtualenv
88+
become: yes
89+
pip:
90+
name: "{{ item }}"
91+
virtualenv: /opt/stackstorm/st2
92+
state: present
93+
register: _task
94+
retries: 5
95+
delay: 3
96+
until: _task is succeeded
97+
with_items: "{{ st2_python_packages }}"
98+
notify:
99+
- restart st2
100+
tags: st2
101+
87102
- name: Perform st2 version related operations
88103
import_tasks: version.yml
89104
tags: st2, version

0 commit comments

Comments
 (0)