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
edx
configuration
Commits
a1aae5cf
Commit
a1aae5cf
authored
Jun 05, 2014
by
e0d
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1174 from edx/e0d/add-course-requirements
E0d/add course requirements
parents
a6b4d7a3
2917a087
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
7 deletions
+34
-7
playbooks/roles/edx_service/tasks/main.yml
+1
-0
playbooks/roles/xqwatcher/defaults/main.yml
+1
-1
playbooks/roles/xqwatcher/tasks/code_jail.yml
+24
-1
playbooks/roles/xqwatcher/tasks/main.yml
+2
-5
playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2
+1
-0
playbooks/roles/xqwatcher/templates/edx/app/xqwatcher/data/requirements.txt.j2
+5
-0
No files found.
playbooks/roles/edx_service/tasks/main.yml
View file @
a1aae5cf
...
...
@@ -43,6 +43,7 @@
with_items
:
-
"
{{
COMMON_APP_DIR
}}/{{
edx_service_name
}}"
-
"
{{
COMMON_APP_DIR
}}/{{
edx_service_name
}}/venvs"
-
"
{{
COMMON_APP_DIR
}}/{{
edx_service_name
}}/data"
-
name
:
install a bunch of system packages on which edx_service relies
apt
:
pkg={{ item }} state=present
...
...
playbooks/roles/xqwatcher/defaults/main.yml
View file @
a1aae5cf
...
...
@@ -57,7 +57,7 @@ XQWATCHER_GIT_IDENTITY: |
# depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC
# and a key being provided via COMMON_NEWRELIC_LICENSE
XQWATCHER_NEWRELIC_APPNAME
:
"
your
Newrelic
appname"
XQWATCHER_PIP_EXTRA_ARGS
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}"
#
#
# vars are namespace with the module name.
...
...
playbooks/roles/xqwatcher/tasks/code_jail.yml
View file @
a1aae5cf
...
...
@@ -32,9 +32,28 @@
mode=0440 owner=root group=root validate='visudo -c -f %s'
with_items
:
XQWATCHER_COURSES
-
name
:
put code jail into aa-complain
command
:
/usr/sbin/aa-complain "/etc/apparmor.d/code.jail.{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}"
with_items
:
XQWATCHER_COURSES
-
name
:
create jail virtualenv
shell
:
>
/usr/sbin/aa-complain "/etc/apparmor.d/code.jail.{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}" && /usr/local/bin/virtualenv --no-site-packages {{ xqwatcher_venv_base }}/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}
/usr/local/bin/virtualenv --no-site-packages {{ xqwatcher_venv_base }}/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}
with_items
:
XQWATCHER_COURSES
-
name
:
write out requirements.txt
template
:
>
src=edx/app/xqwatcher/data/requirements.txt.j2
dest={{ xqwatcher_data_dir }}/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}-requirements.txt
mode=0440 owner=root group=root
with_items
:
XQWATCHER_COURSES
-
name
:
install course specific python requirements
pip
:
>
requirements="{{ xqwatcher_data_dir }}/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}-requirements.txt"
virtualenv="{{ xqwatcher_venv_base }}/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}"
state=present
extra_args="{{ XQWATCHER_PIP_EXTRA_ARGS }}"
with_items
:
XQWATCHER_COURSES
-
name
:
give other read permissions to the virtualenv
...
...
@@ -49,6 +68,10 @@
command
:
apparmor_parser -r "/etc/apparmor.d/code.jail.{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}"
with_items
:
XQWATCHER_COURSES
#
# Leaves aa in either complain or enforce depending upon the value of the
# CODE_JAIL_COMPLAIN var. Complain mode should never be run in an
# environment where untrusted users can submit code
-
name
:
put code jail into aa-complain
command
:
/usr/sbin/aa-complain "/etc/apparmor.d/code.jail.{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}"
when
:
CODE_JAIL_COMPLAIN
...
...
playbooks/roles/xqwatcher/tasks/main.yml
View file @
a1aae5cf
...
...
@@ -93,14 +93,11 @@
owner="{{ xqwatcher_user }}"
group="{{ xqwatcher_user }}"
-
name
:
create
supervisor dirs
-
name
:
create
conf.d dir
file
:
>
path="{{ xqwatcher_conf_dir }}"
path="{{ xqwatcher_conf_dir }}
/conf.d
"
state=directory
owner="{{ xqwatcher_user }}"
group="{{ xqwatcher_user }}"
with_items
:
-
"
{{
xqwatcher_supervisor_data_dir
}}"
-
"
{{
xqwatcher_supervisor_log_dir
}}"
-
include
:
deploy.yml tags=deploy
playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2
View file @
a1aae5cf
...
...
@@ -10,6 +10,7 @@
[program:xqwatcher]
command={{ executable }} -m {{ xqwatcher_module }} -d {{ xqwatcher_conf_dir }}
process_name=%(program_name)s
user={{ xqwatcher_user }}
directory={{ xqwatcher_code_dir }}
stdout_logfile={{ xqwatcher_supervisor_log_dir }}/%(program_name)-stdout.log
stderr_logfile={{ xqwatcher_supervisor_log_dir }}/%(program_name)-stderr.log
...
...
playbooks/roles/xqwatcher/templates/edx/app/xqwatcher/data/requirements.txt.j2
0 → 100644
View file @
a1aae5cf
# {{ ansible_managed }}
{% for requirement in item.PYTHON_REQUIREMENTS %}
{{ requirement.name }}=={{ requirement.version }}
{% endfor %}
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