forked from minrk/salt-states
-
Notifications
You must be signed in to change notification settings - Fork 0
/
virtualenv.sls
58 lines (52 loc) · 1.13 KB
/
virtualenv.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
include:
- pip
virtualenv-command:
pip.installed:
- name: virtualenv
- require:
- cmd: pip-command
{% if 'builds' in pillar %}
{% for build in pillar['builds'] %}
{% with project_dir = ['/var', 'www', pillar['client'], pillar['project']]|join("/") %}
{{ project_dir }}/virtualenvs/{{ build }}:
virtualenv.managed:
- no_site_packages: True
- require:
- pip: virtualenv-command
{{ project_dir }}/virtualenvs/{{ build }}/bin/activate:
file.append:
- text:
- export DJANGO_CONF="conf.{{ build }}"
{{ project_dir }}/run/{{ build }}:
file.directory:
- makedirs: True
- user: www-data
- group: www-data
- mode: 0755
- recurse:
- user
- group
- mode
{{ project_dir }}/logs/{{ build }}:
file.directory:
- makedirs: True
- user: www-data
- group: www-data
- mode: 0755
- recurse:
- user
- group
- mode
{{ project_dir }}/media/{{ build }}:
file.directory:
- makedirs: True
- user: www-data
- group: www-data
- mode: 0755
- recurse:
- user
- group
- mode
{% endwith %}
{% endfor %}
{% endif %}