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
ea873168
Commit
ea873168
authored
Jun 01, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the YAML style parameter passing
parent
6e7fb883
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
40 deletions
+67
-40
playbooks/roles/edxapp/tasks/main.yml
+8
-8
playbooks/roles/edxapp/tasks/python_sandbox_env.yml
+52
-26
playbooks/roles/edxapp/tasks/tag_ec2.yml
+7
-6
No files found.
playbooks/roles/edxapp/tasks/main.yml
View file @
ea873168
...
...
@@ -50,7 +50,7 @@
tags
:
-
install
-
install:base
-
name
:
create edxapp log dir
file
:
path
:
"
{{
edxapp_log_dir
}}"
...
...
@@ -60,7 +60,7 @@
tags
:
-
install
-
install:base
-
name
:
create web-writable edxapp data dirs
file
:
path
:
"
{{
item
}}"
...
...
@@ -75,7 +75,7 @@
tags
:
-
install
-
install:base
# adding chris-lea nodejs repo
-
name
:
add ppas for current versions of nodejs
apt_repository
:
...
...
@@ -83,7 +83,7 @@
tags
:
-
install
-
install:base
-
name
:
install system packages on which LMS and CMS rely
apt
:
name
:
"
{{
item
}}"
...
...
@@ -93,7 +93,7 @@
tags
:
-
install
-
install:base
-
name
:
set up edxapp .npmrc
template
:
src
:
.npmrc.j2
...
...
@@ -104,7 +104,7 @@
tags
:
-
install
-
install:base
-
name
:
create log directories for service variants
file
:
path
:
"
{{
edxapp_log_dir
}}/{{
item
}}"
...
...
@@ -116,7 +116,7 @@
tags
:
-
install
-
install:base
# Set up the python sandbox execution environment
-
include
:
python_sandbox_env.yml
when
:
EDXAPP_PYTHON_SANDBOX
...
...
@@ -124,5 +124,5 @@
-
deploy
-
include
:
deploy.yml
tags
:
tags
:
-
deploy
playbooks/roles/edxapp/tasks/python_sandbox_env.yml
View file @
ea873168
---
# Set the alternatives this way for blas and lapack to work correctly for the
# MITx 6.341x course.
-
name
:
code sandbox | Check which `libblas` to use
# The `libblas.so.3gf` exists only in 12.04
stat
:
path=
/usr/lib/libblas/libblas.so.3gf
stat
:
path
:
/usr/lib/libblas/libblas.so.3gf
register
:
libblas_file
-
name
:
code sandbox | Use libblas.so.3gf in Ubuntu 12.04
alternatives
:
name=libblas.so.3gf path=/usr/lib/libblas/libblas.so.3gf
-
name
:
code sandbox | Use libblas.so.3gf in Ubuntu
alternatives
:
name
:
libblas.so.3gf
path
:
/usr/lib/libblas/libblas.so.3gf
when
:
libblas_file.stat.exists
-
name
:
code sandbox | Use libblas.so.3 in Ubuntu 14.04
alternatives
:
name=libblas.so.3 path=/usr/lib/libblas/libblas.so.3
-
name
:
code sandbox | Use libblas.so.3 in Ubuntu
alternatives
:
name
:
libblas.so.3
path
:
/usr/lib/libblas/libblas.so.3
when
:
not libblas_file.stat.exists
-
name
:
code sandbox | Check which `liblapac` to use
# The `liblapack.so.3gf` exists only in 12.04
stat
:
path=
/usr/lib/lapack/liblapack.so.3gf
stat
:
path
:
/usr/lib/lapack/liblapack.so.3gf
register
:
liblapack_file
-
name
:
code sandbox | Use liblapack.so.3gf in Ubuntu 12.04
alternatives
:
name=liblapack.so.3gf path=/usr/lib/lapack/liblapack.so.3gf
-
name
:
code sandbox | Use liblapack.so.3gf in Ubuntu
alternatives
:
name
:
liblapack.so.3gf
path
:
/usr/lib/lapack/liblapack.so.3gf
when
:
liblapack_file.stat.exists
-
name
:
code sandbox | Use liblapack.so.3 in Ubuntu 14.04
alternatives
:
name=liblapack.so.3 path=/usr/lib/lapack/liblapack.so.3
-
name
:
code sandbox | Use liblapack.so.3 in Ubuntu
alternatives
:
name
:
liblapack.so.3
path
:
/usr/lib/lapack/liblapack.so.3
when
:
not liblapack_file.stat.exists
-
name
:
code sandbox | Create edxapp sandbox user
user
:
name={{ edxapp_sandbox_user }} shell=/bin/false home={{ edxapp_sandbox_venv_dir }}
user
:
name
:
"
{{
edxapp_sandbox_user
}}"
shell
:
/bin/false
home
:
"
{{
edxapp_sandbox_venv_dir
}}"
tags
:
-
edxapp-sandbox
-
edxapp-sandbox
-
name
:
code sandbox | Install apparmor utils system pkg
apt
:
pkg=apparmor-utils state=present
apt
:
name
:
apparmor-utils
state
:
present
tags
:
-
edxapp-sandbox
-
edxapp-sandbox
-
name
:
code sandbox | write out apparmor code sandbox config
template
:
src=code.sandbox.j2 dest=/etc/apparmor.d/code.sandbox mode=0644 owner=root group=root
template
:
src
:
code.sandbox.j2
dest
:
/etc/apparmor.d/code.sandbox
mode
:
0644
owner
:
root
group
:
root
tags
:
-
edxapp-sandbox
-
edxapp-sandbox
-
name
:
code sandbox | write out sandbox user sudoers config
template
:
src=95-sandbox-sudoer.j2 dest=/etc/sudoers.d/95-{{ edxapp_sandbox_user }} mode=0440 owner=root group=root validate='visudo -c -f %s'
template
:
src
:
95-sandbox-sudoer.j2
dest
:
"
/etc/sudoers.d/95-{{
edxapp_sandbox_user
}}"
mode
:
0440
owner
:
root
group
:
root
validate
:
'
visudo
-c
-f
%s'
tags
:
-
edxapp-sandbox
-
edxapp-sandbox
# we boostrap and enable the apparmor service here.
i
n deploy.yml we disable, deploy, then re-enable
# we boostrap and enable the apparmor service here.
I
n deploy.yml we disable, deploy, then re-enable
# so we need to enable it in main.yml
-
name
:
code sandbox | start apparmor service
service
:
name=apparmor state=started
service
:
name
:
apparmor
state
:
started
tags
:
-
edxapp-sandbox
-
edxapp-sandbox
-
name
:
code sandbox | (bootstrap) load code sandbox profile
command
:
apparmor_parser -r /etc/apparmor.d/code.sandbox
tags
:
-
edxapp-sandbox
-
edxapp-sandbox
-
name
:
code sandbox | (bootstrap) put code sandbox into aa-enforce or aa-complain mode depending on EDXAPP_SANDBOX_ENFORCE
command
:
/usr/sbin/{{ edxapp_aa_command }} /etc/apparmor.d/code.sandbox
tags
:
-
edxapp-sandbox
-
edxapp-sandbox
playbooks/roles/edxapp/tasks/tag_ec2.yml
View file @
ea873168
---
-
name
:
get instance information
action
:
ec2_facts
-
name
:
tag instance with edx_platform version
ec2_tag
:
resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args
:
ec2_tag
:
resource
:
"
{{
ansible_ec2_instance_id
}}"
region
:
"
{{
ansible_ec2_placement_region
}}"
tags
:
"
version:edx_platform"
:
"
{{
edx_platform_repo
}}
{{
edxapp_platform_checkout.after|truncate(7,True,'')
}}"
when
:
edxapp_platform_checkout.after is defined
-
name
:
tag instance with edxapp theme version
ec2_tag
:
resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args
:
-
name
:
tag instance with edxapp theme version
ec2_tag
:
resource
:
"
{{
ansible_ec2_instance_id
}}"
region
:
"
{{
ansible_ec2_placement_region
}}"
tags
:
"
version:edxapp_theme"
:
"
{{
edxapp_theme_source_repo
}}
{{
edxapp_theme_checkout.after|truncate(7,True,'')
}}"
when
:
edxapp_theme_checkout.after is defined
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