Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
bd4dc3ff
Commit
bd4dc3ff
authored
May 13, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use with_items to shorten playbook
parent
16f33398
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
54 deletions
+42
-54
playbooks/roles/discern/tasks/main.yml
+42
-54
No files found.
playbooks/roles/discern/tasks/main.yml
View file @
bd4dc3ff
---
#Stop all services
-
name
:
stop celery
service
:
name=celery state=stopped
sudo
:
True
-
name
:
stop nginx
service
:
name=nginx state=stopped
sudo
:
True
-
name
:
stop discern
service
:
name=discern state=stopped
-
name
:
stop all services
service
:
name={{item}} state=stopped
sudo
:
True
with_items
:
-
celery
-
nginx
-
discern
#Upload config files for django (auth and env)
-
name
:
create discern application config env.json file
template
:
src=env.json.j2 dest=$app_base_dir/env.json
template
:
src=env.json.j2 dest=$app_base_dir/env.json
owner={{remote_user}} group=edx mode=0640
sudo
:
True
-
name
:
create discern auth file auth.json
template
:
src=auth.json.j2 dest=$app_base_dir/auth.json
template
:
src=auth.json.j2 dest=$app_base_dir/auth.json
owner={{remote_user}} group=edx mode=0640
sudo
:
True
#Needed if using redis to prevent memory issues
...
...
@@ -41,12 +36,11 @@
#Create directories for repos
-
name
:
create discern directory and set permissions
file
:
path={{discern_dir}} owner={{remote_user}} group=edx mode=2775 state=directory
sudo
:
True
-
name
:
create ease directory and set permissions
file
:
path={{ease_dir}} owner={{remote_user}} group=edx mode=2775 state=directory
file
:
path={{item}} owner={{remote_user}} group=edx mode=2775 state=directory
sudo
:
True
with_items
:
-
{{
discern_dir
}}
-
{{
ease_dir
}}
#Grab both repos or update
-
name
:
git checkout discern repo into discern_dir
...
...
@@ -56,26 +50,25 @@
git
:
dest={{ease_dir}} repo={{ease_source_repo}} version={{ease_branch}}
#Install system packages
-
name
:
install discern apt packages
command
:
xargs -a {{discern_dir}}/apt-packages.txt apt-get install -y
sudo
:
yes
-
name
:
install ease apt packages
command
:
xargs -a {{ease_dir}}/apt-packages.txt apt-get install -y
-
name
:
install discern and ease apt packages
command
:
xargs -a {{item}}/apt-packages.txt apt-get install -y
sudo
:
yes
with_items
:
-
{{
discern_dir
}}
-
{{
ease_dir
}}
#Numpy has to be a pre-requirement in order for scipy to build
-
name
:
install python pre-requirements for discern
pip
:
requirements="{{
discern_dir
}}/pre-requirements.txt" virtualenv="{{venv_dir}}" state=present
-
name
:
install python pre-requirements for ease
pip
:
requirements="{{ease_dir}}/pre-requirements.txt" virtualenv="{{venv_dir}}" state=present
-
name
:
install python requirements for discern
pip
:
requirements="{{
discern_dir
}}/requirements.txt" virtualenv="{{venv_dir}}" state=present
-
name
:
install python requirements for ease
pip
:
requirements="{{ease_dir}}/requirements.txt" virtualenv="{{venv_dir}}" state=present
-
name
:
install python pre-requirements for discern
and ease
pip
:
requirements="{{
item
}}/pre-requirements.txt" virtualenv="{{venv_dir}}" state=present
with_items
:
-
{{
discern_dir
}}
-
{{
ease_dir
}}
-
name
:
install python requirements for discern
and ease
pip
:
requirements="{{
item
}}/requirements.txt" virtualenv="{{venv_dir}}" state=present
with_items
:
-
{{
discern_dir
}}
-
{{
ease_dir
}}
-
name
:
install ease python package
shell
:
command="{{venv_dir}}/bin/activate; cd {{ease_dir}}; python setup.py install"
...
...
@@ -88,17 +81,16 @@
file
:
path={{nltk_data_dir}} owner={{remote_user}} group=edx mode=2775 state=directory
sudo
:
True
#Run this instead of using the ansible module because the ansible module only support syncdb of these
four
, and does not
#Run this instead of using the ansible module because the ansible module only support syncdb of these
three
, and does not
#support virtualenvs as of this comment
-
name
:
django syncdb for discern
shell
:
ls; {{venv_dir}}/bin/python {{discern_dir}}/manage.py syncdb --noinput --settings={{discern_settings}} --pythonpath={{discern_dir}}
-
name
:
django migrate for discern
shell
:
ls; {{venv_dir}}/bin/python {{discern_dir}}/manage.py migrate --noinput --settings={{discern_settings}} --pythonpath={{discern_dir}}
-
name
:
django collectstatic for discern
shell
:
ls; {{venv_dir}}/bin/python {{discern_dir}}/manage.py collectstatic --noinput --settings={{discern_settings}} --pythonpath={{discern_dir}}
shell
:
ls; {{venv_dir}}/bin/python {{discern_dir}}/manage.py {{item}} --noinput --settings={{discern_settings}} --pythonpath={{discern_dir}}
with_items
:
-
syncdb
-
migrate
-
collectstatic
#Have this separate from the other three because it doesn't take the noinput flag
-
name
:
django update_index for discern
shell
:
ls; {{venv_dir}}/bin/python {{discern_dir}}/manage.py update_index --settings={{discern_settings}} --pythonpath={{discern_dir}}
...
...
@@ -119,15 +111,10 @@
template
:
src=default.j2 dest=/etc/nginx/sites-available/default
sudo
:
True
#start the services up
-
name
:
start celery
service
:
name=celery state=started
sudo
:
True
-
name
:
start nginx
service
:
name=nginx state=started
sudo
:
True
-
name
:
start discern
service
:
name=discern state=started
-
name
:
start all services
service
:
name={{item}} state=started
sudo
:
True
with_items
:
-
celery
-
nginx
-
discern
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment