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
3446a2fb
Commit
3446a2fb
authored
Jun 28, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ansible 2.x error
parent
13173bff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
60 deletions
+61
-60
playbooks/roles/edxapp/tasks/deploy.yml
+25
-24
playbooks/roles/edxapp/tasks/main.yml
+9
-9
playbooks/roles/edxapp/tasks/python_sandbox_env.yml
+13
-13
playbooks/roles/edxapp/tasks/service_variant_config.yml
+11
-11
playbooks/roles/edxapp/tasks/tag_ec2.yml
+3
-3
No files found.
playbooks/roles/edxapp/tasks/deploy.yml
View file @
3446a2fb
---
-
name
:
c
reate edxapp configuration dir
-
name
:
C
reate edxapp configuration dir
file
:
path
:
"
{{
EDXAPP_CFG_DIR
}}"
state
:
directory
...
...
@@ -9,7 +9,7 @@
-
install
-
install:base
-
name
:
c
opy the template to the desired location
-
name
:
C
opy the template to the desired location
template
:
src
:
"
{{
item.src
}}"
dest
:
"
{{
item.dest
}}"
...
...
@@ -24,7 +24,7 @@
-
install
-
install:base
-
name
:
i
nstall read-only ssh key
-
name
:
I
nstall read-only ssh key
copy
:
content
:
"
{{
EDXAPP_GIT_IDENTITY
}}"
dest
:
"
{{
edxapp_git_identity
}}"
...
...
@@ -36,7 +36,7 @@
-
install
-
install:base
-
name
:
s
et git fetch.prune to ignore deleted remote refs
-
name
:
S
et git fetch.prune to ignore deleted remote refs
shell
:
git config --global fetch.prune
true
become_user
:
"
{{
edxapp_user
}}"
tags
:
...
...
@@ -44,7 +44,7 @@
-
install:base
# Do A Checkout
-
name
:
c
heckout edx-platform repo into {{ edxapp_code_dir }}
-
name
:
C
heckout edx-platform repo into {{ edxapp_code_dir }}
git_2_0_1
:
dest
:
"
{{
edxapp_code_dir
}}"
repo
:
"
{{
edx_platform_repo
}}"
...
...
@@ -58,7 +58,7 @@
-
install
-
install:code
-
name
:
g
it clean after checking out edx-platform
-
name
:
G
it clean after checking out edx-platform
shell
:
cd {{ edxapp_code_dir }} && git clean -xdf
become_user
:
"
{{
edxapp_user
}}"
tags
:
...
...
@@ -71,7 +71,7 @@
# To enable Stanford theming, point edxapp_theme_source_repo
# (yes, lowercase) to a Stanford-style theme and set
# edxapp_theme_name (again, lowercase) to its name.
-
name
:
c
heckout Stanford-style theme
-
name
:
C
heckout Stanford-style theme
git_2_0_1
:
dest
:
"
{{
edxapp_app_dir
}}/themes/{{
edxapp_theme_name
}}"
repo
:
"
{{
edxapp_theme_source_repo
}}"
...
...
@@ -90,7 +90,7 @@
# EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO to your theme repo, and set
# EDXAPP_COMPREHENSIVE_THEME_DIR to the directory you want to check
# out to.
-
name
:
c
heckout comprehensive theme
-
name
:
C
heckout comprehensive theme
git_2_0_1
:
dest
:
"
{{
EDXAPP_COMPREHENSIVE_THEME_DIR
}}"
repo
:
"
{{
EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO
}}"
...
...
@@ -197,7 +197,7 @@
# Private requriements require a ssh key to install, use the same key as the private key for edx-platform
# If EDXAPP_INSTALL_PRIVATE_REQUIREMENTS is set to true EDXAPP_USE_GIT_IDENTITY must also be true
-
name
:
i
nstall python private requirements
-
name
:
I
nstall python private requirements
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
...
...
@@ -215,7 +215,7 @@
-
install:app-requirements
# Install any custom extra requirements if defined in EDXAPP_EXTRA_REQUIREMENTS.
-
name
:
i
nstall python extra requirements
-
name
:
I
nstall python extra requirements
pip
:
name
:
"
{{
item.name
}}"
version
:
"
{{
item.version|default(omit)
}}"
...
...
@@ -230,7 +230,7 @@
# If using CAS and you have a function for mapping attributes, install
# the module here. The next few tasks set up the python code sandbox
-
name
:
i
nstall CAS attribute module
-
name
:
I
nstall CAS attribute module
pip
:
name
:
"
{{
EDXAPP_CAS_ATTRIBUTE_PACKAGE
}}"
virtualenv
:
"
{{
edxapp_venv_dir
}}"
...
...
@@ -243,7 +243,7 @@
-
install:app-requirements
# Install the sandbox python modules into {{ edxapp_venv_dir }}
-
name
:
i
nstall sandbox requirements into regular venv
-
name
:
I
nstall sandbox requirements into regular venv
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
...
...
@@ -264,7 +264,7 @@
# need to disable this profile, otherwise the pip inside the sandbox venv has no permissions
# to install anything
-
name
:
c
ode sandbox | put sandbox apparmor profile in complain mode
-
name
:
C
ode sandbox | put sandbox apparmor profile in complain mode
command
:
/usr/sbin/aa-complain /etc/apparmor.d/code.sandbox
when
:
EDXAPP_PYTHON_SANDBOX
tags
:
...
...
@@ -272,7 +272,7 @@
-
install
-
install:app-requirements
-
name
:
c
ode sandbox | Install base sandbox requirements and create sandbox virtualenv
-
name
:
C
ode sandbox | Install base sandbox requirements and create sandbox virtualenv
pip
:
requirements
:
"
{{
sandbox_base_requirements
}}"
virtualenv
:
"
{{
edxapp_sandbox_venv_dir
}}"
...
...
@@ -285,7 +285,7 @@
-
install
-
install:app-requirements
-
name
:
c
ode sandbox | Install sandbox requirements into sandbox venv
-
name
:
C
ode sandbox | Install sandbox requirements into sandbox venv
shell
:
>
{{ edxapp_sandbox_venv_dir }}/bin/pip install -i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w -r {{ item }}
chdir={{ edxapp_code_dir }}
...
...
@@ -301,7 +301,7 @@
-
install
-
install:app-requirements
-
name
:
c
ode sandbox | put code sandbox into aa-enforce or aa-complain mode, depending on EDXAPP_SANDBOX_ENFORCE
-
name
:
C
ode sandbox | 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
when
:
EDXAPP_PYTHON_SANDBOX
tags
:
...
...
@@ -309,7 +309,7 @@
-
install
-
install:app-requirements
-
name
:
c
ompiling all py files in the edx-platform repo
-
name
:
C
ompiling all py files in the edx-platform repo
shell
:
"
{{
edxapp_venv_bin
}}/python
-m
compileall
-q
-x
.git/.*
{{
edxapp_code_dir
}}"
become_user
:
"
{{
edxapp_user
}}"
tags
:
...
...
@@ -319,7 +319,7 @@
# alternative would be to give {{ common_web_user }} read access
# to the virtualenv but that permission change will require
# root access.
-
name
:
g
ive other read permissions to the virtualenv
-
name
:
G
ive other read permissions to the virtualenv
file
:
path
:
"
{{
edxapp_venv_dir
}}"
state
:
directory
...
...
@@ -342,7 +342,7 @@
# the services if any of the configurations
# have changed.
-
name
:
u
pdate supervisor configuration
-
name
:
U
pdate supervisor configuration
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update"
register
:
supervisor_update
become_user
:
"
{{
supervisor_service_user
}}"
...
...
@@ -351,7 +351,7 @@
tags
:
-
manage
-
name
:
e
nsure edxapp has started
-
name
:
E
nsure edxapp has started
supervisorctl
:
name
:
"
edxapp:"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
...
...
@@ -362,7 +362,7 @@
tags
:
-
manage
-
name
:
e
nsure edxapp_workers has started
-
name
:
E
nsure edxapp_workers has started
supervisorctl
:
name
:
"
edxapp_worker:"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
...
...
@@ -373,7 +373,7 @@
tags
:
-
manage
-
name
:
c
reate symlinks from the venv bin dir and repo dir
-
name
:
C
reate symlinks from the venv bin dir and repo dir
file
:
src
:
"
{{
item
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
(item
|
basename).split('.',
1)
|
first
}}.edxapp"
...
...
@@ -387,7 +387,7 @@
-
install
-
install:configuration
-
name
:
r
emove read-only ssh key
-
name
:
R
emove read-only ssh key
file
:
path
:
"
{{
edxapp_git_identity
}}"
state
:
absent
...
...
@@ -397,9 +397,10 @@
-
install:configuration
-
install:code
-
include
:
tag_ec2.yml
tags=deploy
-
include
:
tag_ec2.yml
when
:
COMMON_TAG_EC2_INSTANCE
tags
:
-
deploy
-
remove
-
aws
...
...
playbooks/roles/edxapp/tasks/main.yml
View file @
3446a2fb
...
...
@@ -2,7 +2,7 @@
# - group_vars/all
# - common/tasks/main.yml
---
-
name
:
c
reate application user
-
name
:
C
reate application user
user
:
name
:
"
{{
edxapp_user
}}"
home
:
"
{{
edxapp_app_dir
}}"
...
...
@@ -12,7 +12,7 @@
-
install
-
install:base
-
name
:
c
reate edxapp user dirs
-
name
:
C
reate edxapp user dirs
file
:
path
:
"
{{
item.path
}}"
state
:
directory
...
...
@@ -40,7 +40,7 @@
# we currently can't override the DATA_DIR var
# in edx-platform. TODO: This can be removed once
# VPC-122 is closed
-
name
:
m
ake the course data dir
-
name
:
M
ake the course data dir
file
:
src
:
"
{{
edxapp_course_data_dir
}}"
dest
:
"
{{
edxapp_legacy_course_data_dir
}}"
...
...
@@ -51,7 +51,7 @@
-
install
-
install:base
-
name
:
c
reate edxapp log dir
-
name
:
C
reate edxapp log dir
file
:
path
:
"
{{
edxapp_log_dir
}}"
state
:
directory
...
...
@@ -61,7 +61,7 @@
-
install
-
install:base
-
name
:
c
reate web-writable edxapp data dirs
-
name
:
C
reate web-writable edxapp data dirs
file
:
path
:
"
{{
item
}}"
state
:
directory
...
...
@@ -77,14 +77,14 @@
-
install:base
# adding chris-lea nodejs repo
-
name
:
a
dd ppas for current versions of nodejs
-
name
:
A
dd ppas for current versions of nodejs
apt_repository
:
repo
:
"
{{
edxapp_chrislea_ppa
}}"
tags
:
-
install
-
install:base
-
name
:
i
nstall system packages on which LMS and CMS rely
-
name
:
I
nstall system packages on which LMS and CMS rely
apt
:
name
:
"
{{
item
}}"
state
:
present
...
...
@@ -94,7 +94,7 @@
-
install
-
install:base
-
name
:
s
et up edxapp .npmrc
-
name
:
S
et up edxapp .npmrc
template
:
src
:
.npmrc.j2
dest
:
"
{{
edxapp_app_dir
}}/.npmrc"
...
...
@@ -105,7 +105,7 @@
-
install
-
install:base
-
name
:
c
reate log directories for service variants
-
name
:
C
reate log directories for service variants
file
:
path
:
"
{{
edxapp_log_dir
}}/{{
item
}}"
state
:
directory
...
...
playbooks/roles/edxapp/tasks/python_sandbox_env.yml
View file @
3446a2fb
---
# Set the alternatives this way for blas and lapack to work correctly for the
# MITx 6.341x course.
-
name
:
c
ode sandbox | Check which `libblas` to use
-
name
:
C
ode sandbox | Check which `libblas` to use
stat
:
path
:
/usr/lib/libblas/libblas.so.3gf
register
:
libblas_file
-
name
:
c
ode sandbox | Use libblas.so.3gf in Ubuntu
-
name
:
C
ode 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
:
c
ode sandbox | Use libblas.so.3 in Ubuntu
-
name
:
C
ode 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
:
c
ode sandbox | Check which `liblapac` to use
-
name
:
C
ode sandbox | Check which `liblapac` to use
stat
:
path
:
/usr/lib/lapack/liblapack.so.3gf
register
:
liblapack_file
-
name
:
c
ode sandbox | Use liblapack.so.3gf in Ubuntu
-
name
:
C
ode 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
:
c
ode sandbox | Use liblapack.so.3 in Ubuntu
-
name
:
C
ode 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
:
c
ode sandbox | Create edxapp sandbox user
-
name
:
C
ode sandbox | Create edxapp sandbox user
user
:
name
:
"
{{
edxapp_sandbox_user
}}"
shell
:
/bin/false
...
...
@@ -44,14 +44,14 @@
tags
:
-
edxapp-sandbox
-
name
:
c
ode sandbox | Install apparmor utils system pkg
-
name
:
C
ode sandbox | Install apparmor utils system pkg
apt
:
name
:
apparmor-utils
state
:
present
tags
:
-
edxapp-sandbox
-
name
:
c
ode sandbox | write out apparmor code sandbox config
-
name
:
C
ode sandbox | write out apparmor code sandbox config
template
:
src
:
code.sandbox.j2
dest
:
/etc/apparmor.d/code.sandbox
...
...
@@ -61,7 +61,7 @@
tags
:
-
edxapp-sandbox
-
name
:
c
ode sandbox | write out sandbox user sudoers config
-
name
:
C
ode sandbox | write out sandbox user sudoers config
template
:
src
:
95-sandbox-sudoer.j2
dest
:
"
/etc/sudoers.d/95-{{
edxapp_sandbox_user
}}"
...
...
@@ -74,19 +74,19 @@
# we boostrap and enable the apparmor service here. In deploy.yml we disable, deploy, then re-enable
# so we need to enable it in main.yml
-
name
:
c
ode sandbox | start apparmor service
-
name
:
C
ode sandbox | start apparmor service
service
:
name
:
apparmor
state
:
started
tags
:
-
edxapp-sandbox
-
name
:
c
ode sandbox | (bootstrap) load code sandbox profile
-
name
:
C
ode sandbox | (bootstrap) load code sandbox profile
command
:
apparmor_parser -r /etc/apparmor.d/code.sandbox
tags
:
-
edxapp-sandbox
-
name
:
c
ode sandbox | (bootstrap) put code sandbox into aa-enforce or aa-complain mode depending on EDXAPP_SANDBOX_ENFORCE
-
name
:
C
ode 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
playbooks/roles/edxapp/tasks/service_variant_config.yml
View file @
3446a2fb
---
-
name
:
c
reate application and auth config
-
name
:
C
reate application and auth config
template
:
src
:
"
{{
item[0]
}}.{{
item[1]
}}.json.j2"
dest
:
"
{{
edxapp_app_dir
}}/{{
item[0]
}}.{{
item[1]
}}.json"
...
...
@@ -12,7 +12,7 @@
-
install:configuration
-
edxapp_cfg
-
name
:
c
reate auth and application yaml config
-
name
:
C
reate auth and application yaml config
template
:
src
:
"
{{
item[0]
}}.{{
item[1]
}}.yaml.j2"
dest
:
"
{{
EDXAPP_CFG_DIR
}}/{{
item[0]
}}.{{
item[1]
}}.yaml"
...
...
@@ -26,7 +26,7 @@
-
edxapp_cfg
# write the supervisor scripts for the service variants
-
name
:
"
w
riting
{{
item
}}
supervisor
script"
-
name
:
"
W
riting
{{
item
}}
supervisor
script"
template
:
src
:
"
{{
item
}}.conf.j2"
dest
:
"
{{
supervisor_available_dir
}}/{{
item
}}.conf"
...
...
@@ -39,7 +39,7 @@
-
install:configuration
# write the supervisor script for edxapp and celery workers
-
name
:
w
riting edxapp and celery supervisor scripts
-
name
:
W
riting edxapp and celery supervisor scripts
template
:
src
:
"
{{
item
}}.j2"
dest
:
"
{{
supervisor_available_dir
}}/{{
item
}}"
...
...
@@ -53,7 +53,7 @@
-
install
-
install:configuration
-
name
:
a
dd gunicorn configuration files
-
name
:
A
dd gunicorn configuration files
template
:
src
:
"
{{
item
}}_gunicorn.py.j2"
dest
:
"
{{
edxapp_app_dir
}}/{{
item
}}_gunicorn.py"
...
...
@@ -64,7 +64,7 @@
-
install:configuration
# Enable the supervisor jobs
-
name
:
"
e
nable
{{
item
}}
supervisor
script"
-
name
:
"
E
nable
{{
item
}}
supervisor
script"
file
:
src
:
"
{{
supervisor_available_dir
}}/{{
item
}}.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/{{
item
}}.conf"
...
...
@@ -77,7 +77,7 @@
-
install
-
install:configuration
-
name
:
e
nable edxapp supervisor script
-
name
:
E
nable edxapp supervisor script
file
:
src
:
"
{{
supervisor_available_dir
}}/edxapp.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/edxapp.conf"
...
...
@@ -89,7 +89,7 @@
-
install
-
install:configuration
-
name
:
e
nable celery worker supervisor script
-
name
:
E
nable celery worker supervisor script
file
:
src
:
"
{{
supervisor_available_dir
}}/workers.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/workers.conf"
...
...
@@ -101,7 +101,7 @@
-
install
-
install:configuration
-
name
:
c
reate helper scripts for managing edxapp
-
name
:
C
reate helper scripts for managing edxapp
template
:
src
:
"
edx/bin/{{
item[0]
}}-{{
item[1]
}}.j2"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
item[0]
}}-{{
item[1]
}}"
...
...
@@ -115,7 +115,7 @@
-
install:configuration
# migrate when the migrate user is overridden in extra vars
-
name
:
m
igrate
-
name
:
M
igrate
command
:
"
{{
COMMON_BIN_DIR
}}/edxapp-migrate-{{
item
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS and item != "lms-preview"
environment
:
...
...
@@ -145,7 +145,7 @@
-
assets
# Gather assets using paver if possible
-
name
:
"
g
ather
{{
item
}}
static
assets
with
paver"
-
name
:
"
G
ather
{{
item
}}
static
assets
with
paver"
command
:
"
{{
COMMON_BIN_DIR
}}/edxapp-update-assets-{{
item
}}"
when
:
celery_worker is not defined and not devstack and item != "lms-preview"
with_items
:
"
{{
service_variants_enabled
}}"
...
...
playbooks/roles/edxapp/tasks/tag_ec2.yml
View file @
3446a2fb
---
-
name
:
g
et instance information
-
name
:
G
et instance information
action
:
ec2_facts
-
name
:
t
ag instance with edx_platform version
-
name
:
T
ag instance with edx_platform version
ec2_tag
:
resource
:
"
{{
ansible_ec2_instance_id
}}"
region
:
"
{{
ansible_ec2_placement_region
}}"
...
...
@@ -10,7 +10,7 @@
"
version:edx_platform"
:
"
{{
edx_platform_repo
}}
{{
edxapp_platform_checkout.after|truncate(7,True,'')
}}"
when
:
edxapp_platform_checkout.after is defined
-
name
:
t
ag instance with edxapp theme version
-
name
:
T
ag instance with edxapp theme version
ec2_tag
:
resource
:
"
{{
ansible_ec2_instance_id
}}"
region
:
"
{{
ansible_ec2_placement_region
}}"
...
...
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