Skip to content

Commit ace3c47

Browse files
authored
Merge pull request #33 from onaio/allow-defining-python-setuptools-version
Add task to install dependency packages
2 parents afc3de8 + 7f9862b commit ace3c47

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

defaults/main.yml

+5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ django_recreate_virtual_env: false
5454
## pipenv
5555
django_use_pipenv: false
5656

57+
## dependency pip packages
58+
## packages you'd want to install before install packages in the requirement's file
59+
django_dependency_pip_packages: []
60+
5761
## pip
5862
django_use_regular_old_pip: true
5963
django_pip_paths:
@@ -63,6 +67,7 @@ django_pip_paths:
6367
django_pip_packages:
6468
- celery
6569
- uwsgi
70+
django_pip_packages_extra_args:
6671

6772
# Django
6873
django_local_settings_path:

tasks/celery.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@
1616
template:
1717
src: templates/etc/default/celeryd.j2
1818
dest: /etc/default/celeryd-{{ django_system_user }}
19-
mode: 0644
19+
mode: "0644"
2020

2121
- name: Copy celerybeat default script
2222
template:
2323
src: templates/etc/default/celerybeat.j2
2424
dest: /etc/default/celerybeat-{{ django_system_user }}
25-
mode: 0644
25+
mode: "0644"
2626

2727
- name: Copy celeryd upstart script
2828
template:
2929
src: "etc/systemd/celeryd.service.j2"
3030
dest: "/etc/systemd/system/{{ django_celeryd_service_name }}.service"
31-
mode: 0644
31+
mode: "0644"
3232
notify:
3333
- restart_celery
3434

3535
- name: Copy celerybeat upstart script
3636
template:
3737
src: "etc/systemd/celerybeat.service.j2"
3838
dest: "/etc/systemd/system/{{ django_celerybeat_service_name }}.service"
39-
mode: 0644
39+
mode: "0644"
4040
notify:
41-
- restart_celery
41+
- restart_celery

tasks/install.yml

+10
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@
111111
name: pip
112112
state: present
113113

114+
- name: Install dependency Python packages using pip
115+
pip:
116+
name: "{{ django_dependency_pip_packages }}"
117+
state: present
118+
virtualenv: "{{ django_venv_path }}"
119+
virtualenv_python: "{{ django_python_version }}"
120+
become: true
121+
become_user: "{{ django_system_user }}"
122+
114123
- name: Install Python packages using pip
115124
pip:
116125
state: present
@@ -154,6 +163,7 @@
154163
state: present
155164
virtualenv: "{{ django_venv_path }}"
156165
virtualenv_python: "{{ django_python_version }}"
166+
extra_args: "{{ django_pip_packages_extra_args }}"
157167
become: true
158168
become_user: "{{ django_system_user }}"
159169

tasks/service.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
template:
44
src: "etc/default/django_service_name.j2"
55
dest: "/etc/default/{{ django_service_name }}"
6-
mode: 0640
6+
mode: "0640"
77
owner: "{{ django_system_user }}"
88
group: "{{ django_system_group }}"
99
notify:
@@ -13,8 +13,8 @@
1313
template:
1414
src: "etc/systemd/django.service.j2"
1515
dest: /etc/systemd/system/{{ item }}
16-
mode: 0644
16+
mode: "0644"
1717
notify:
1818
- restart_service
1919
with_items:
20-
- "{{ django_service_name }}.service"
20+
- "{{ django_service_name }}.service"

0 commit comments

Comments
 (0)