Commit 074b4f02 by Feanil Patel

Merge pull request #112 from edx/feanil/edxapp_gunicorn

Feanil/edxapp gunicorn
parents 1bf7c923 0811918a
......@@ -6,5 +6,4 @@
roles:
- common
- nginx
- gunicorn
- edxapp
......@@ -22,13 +22,19 @@
- install
- name: create edx virtualenv directory
file: path=$venv_dir owner=ubuntu group=adm mode=2775 state=directory
file: path={{ venv_dir }} owner=ubuntu group=adm mode=2775 state=directory
tags:
- venv_base
- install
- name: create the edx virtualenv directory initial contents
command: /usr/local/bin/virtualenv $venv_dir --distribute creates=$venv_dir/bin/activate
command: /usr/local/bin/virtualenv {{ venv_dir }} --distribute creates=$venv_dir/bin/activate
tags:
- venv_base
- install
- name: pip install gunicorn
pip: name=gunicorn virtualenv="{{venv_dir}}" state=present
tags:
- gunicorn
- install
......@@ -30,4 +30,4 @@
- update
# Creates LMS upstart file
- include: ../../gunicorn/tasks/upstart.yml service_variant=cms
- include: upstart.yml service_variant=cms
......@@ -28,4 +28,4 @@
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-preview-backend
# Creates LMS Preview upstart file
- include: ../../gunicorn/tasks/upstart.yml service_variant=lms-preview
- include: upstart.yml service_variant=lms-preview
......@@ -30,4 +30,4 @@
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-xml-backend
# Creates upstart file
- include: ../../gunicorn/tasks/upstart.yml service_variant=lms-xml
- include: upstart.yml service_variant=lms-xml
......@@ -24,4 +24,4 @@
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-backend
# Creates LMS upstart file
- include: ../../gunicorn/tasks/upstart.yml service_variant=lms
- include: upstart.yml service_variant=lms
......@@ -71,6 +71,14 @@
- include: lms-preview.yml
when: "'lms-preview' in service_variants_enabled"
- name: creating edxapp upstart script
sudo: True
template: src=edxapp.conf.j2 dest=/etc/init/edxapp.conf owner=root group=root
tags:
- upstart
- gunicorn
- update
- include: npm.yml
- include: ruby.yml
- include: deploy.yml
# write the gunicorn upstart script for {{ service_variant }}
- name: writing {{ service_variant }} upstart script to /etc/init
sudo: True
template: src={{ service_variant }}.conf.j2 dest=/etc/init/{{ service_variant }}.conf owner=root group=root
tags:
- upstart
- gunicorn
- update
---
- name: restart lms
service: name=lms state=restarted
sudo: True
- name: restart cms
service: name=cms state=restarted
sudo: True
- name: restart lms-preview
service: name=lms-preview state=restarted
sudo: True
---
- name: pip install gunicorn
pip: name=gunicorn virtualenv="{{venv_dir}}" state=present
tags:
- gunicorn
- install
- name: creating edxapp upstart script
sudo: True
template: src=edxapp.conf.j2 dest=/etc/init/edxapp.conf owner=root group=root
tags:
- upstart
- gunicorn
- update
#write the gunicorn upstart script for {{ service_variant }}
- name: writing ${service_variant} upstart script to /etc/init
sudo: True
template: src={{ item }} dest=/etc/init/${service_variant}.conf owner=root group=root
first_available_file:
- "{{ local_dir }}/gunicorn/templates/{{ service_variant }}.conf.j2"
# seems like paths in first_available_file must be relative to the playbooks dir
- "roles/gunicorn/templates/{{ service_variant }}.conf.j2"
tags:
- upstart
- gunicorn
- update
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