Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add task to install dependency packages #33

Merged
merged 3 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ django_recreate_virtual_env: false
## pipenv
django_use_pipenv: false

## dependency pip packages
## packages you'd want to install before install packages in the requirement's file
django_dependency_pip_packages: []

## pip
django_use_regular_old_pip: true
django_pip_paths:
Expand All @@ -63,6 +67,7 @@ django_pip_paths:
django_pip_packages:
evansmurithi marked this conversation as resolved.
Show resolved Hide resolved
- celery
- uwsgi
django_pip_packages_extra_args:

# Django
django_local_settings_path:
Expand Down
10 changes: 5 additions & 5 deletions tasks/celery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@
template:
src: templates/etc/default/celeryd.j2
dest: /etc/default/celeryd-{{ django_system_user }}
mode: 0644
mode: "0644"

- name: Copy celerybeat default script
template:
src: templates/etc/default/celerybeat.j2
dest: /etc/default/celerybeat-{{ django_system_user }}
mode: 0644
mode: "0644"

- name: Copy celeryd upstart script
template:
src: "etc/systemd/celeryd.service.j2"
dest: "/etc/systemd/system/{{ django_celeryd_service_name }}.service"
mode: 0644
mode: "0644"
notify:
- restart_celery

- name: Copy celerybeat upstart script
template:
src: "etc/systemd/celerybeat.service.j2"
dest: "/etc/systemd/system/{{ django_celerybeat_service_name }}.service"
mode: 0644
mode: "0644"
notify:
- restart_celery
- restart_celery
10 changes: 10 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@
name: pip
state: present

- name: Install dependency Python packages using pip
pip:
name: "{{ django_dependency_pip_packages }}"
state: present
virtualenv: "{{ django_venv_path }}"
virtualenv_python: "{{ django_python_version }}"
become: true
become_user: "{{ django_system_user }}"

- name: Install Python packages using pip
pip:
state: present
Expand Down Expand Up @@ -154,6 +163,7 @@
state: present
virtualenv: "{{ django_venv_path }}"
virtualenv_python: "{{ django_python_version }}"
extra_args: "{{ django_pip_packages_extra_args }}"
become: true
become_user: "{{ django_system_user }}"

Expand Down
6 changes: 3 additions & 3 deletions tasks/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
template:
src: "etc/default/django_service_name.j2"
dest: "/etc/default/{{ django_service_name }}"
mode: 0640
mode: "0640"
owner: "{{ django_system_user }}"
group: "{{ django_system_group }}"
notify:
Expand All @@ -13,8 +13,8 @@
template:
src: "etc/systemd/django.service.j2"
dest: /etc/systemd/system/{{ item }}
mode: 0644
mode: "0644"
notify:
- restart_service
with_items:
- "{{ django_service_name }}.service"
- "{{ django_service_name }}.service"