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
05b6439b
Commit
05b6439b
authored
Dec 10, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding helper scripts in /edx/bin
This adds some helper scripts for managing the edx server.
parent
809170c9
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
82 additions
and
14 deletions
+82
-14
playbooks/roles/edxapp/defaults/main.yml
+14
-1
playbooks/roles/edxapp/tasks/service_variant_config.yml
+13
-11
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-cms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-lms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-runserver-cms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-runserver-lms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-shell-cms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-shell-lms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-syncdb-cms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-syncdb-lms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets-cms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets-lms.j2
+3
-0
playbooks/roles/edxapp/templates/edx/bin/edxapp_common.j2
+11
-0
playbooks/roles/supervisor/tasks/main.yml
+12
-2
playbooks/roles/supervisor/templates/edx/bin/supervisorctl.j2
+2
-0
No files found.
playbooks/roles/edxapp/defaults/main.yml
View file @
05b6439b
...
...
@@ -439,6 +439,12 @@ edxapp_all_req_files:
# TODO: old style variable syntax is necessary
# for lists and dictionaries
edxapp_helper_scripts
:
-
edxapp-migrate
-
edxapp-runserver
-
edxapp-syncdb
-
edxapp-update-assets
-
edxapp-shell
edxapp_environment
:
LANG
:
"
{{
EDXAPP_LANG
}}"
...
...
@@ -448,7 +454,14 @@ edxapp_environment:
GEM_HOME
:
"
{{
edxapp_gem_root
}}"
GEM_PATH
:
"
{{
edxapp_gem_root
}}"
PATH
:
"
{{
edxapp_deploy_path
}}"
# the settings module for edxapp, DJANGO_SETTINGS_MODULE
# should be set to ${SERVICE_VARIANT}.${EDXAPP_SETTINGS}
# where SERVICE_VARIANT is lms or cms
EDX_PLATFORM_SETTINGS
:
aws
# Current set to the app dir for json config, this should
# be updated to /edx/etc/edxapp when the switch to
# yaml based configs is complete
CONFIG_ROOT
:
"
{{
edxapp_app_dir
}}"
edxapp_generic_auth_config
:
&edxapp_generic_auth
ANALYTICS_DATA_TOKEN
:
"
{{
EDXAPP_ANALYTICS_DATA_TOKEN
}}"
...
...
playbooks/roles/edxapp/tasks/service_variant_config.yml
View file @
05b6439b
...
...
@@ -106,16 +106,24 @@
when
:
celery_worker is defined and not disable_edx_services
sudo_user
:
"
{{
supervisor_user
}}"
-
name
:
create helper scripts for managing edxapp
template
:
>
src=edx/bin/{{ item[0] }}-{{ item[1] }}.j2
dest={{ COMMON_BIN_DIR }}/{{ item[0] }}-{{ item[1] }}
owner={{ edxapp_user }}
mode=0755
with_nested
:
-
edxapp_helper_scripts
-
service_variants_enabled
# Syncdb with migrate when the migrate user is overridden in extra vars
-
name
:
syncdb and migrate
shell
:
>
chdir={{ edxapp_code_dir }}
{{ edxapp_venv_bin}}/python manage.py {{ item }} syncdb --migrate --noinput --settings=aws_migrate
command
:
"
{{
COMMON_BIN_DIR
}}/edxapp-syncdb-{{
item
}}"
when
:
fake_migrations is not defined and migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS and item != "lms-preview"
environment
:
DB_MIGRATION_USER
:
"
{{
COMMON_MYSQL_MIGRATE_USER
}}"
DB_MIGRATION_PASS
:
"
{{
COMMON_MYSQL_MIGRATE_PASS
}}"
sudo_user
:
"
{{
edxapp_user
}}
"
EDX_PLATFORM_SETTINGS_OVERRIDE
:
"
aws_migrate
"
with_items
:
service_variants_enabled
notify
:
-
"
restart
edxapp"
...
...
@@ -124,15 +132,9 @@
# Gather assets using paver if possible
-
name
:
gather {{ item }} static assets with paver
shell
:
>
SERVICE_VARIANT={{ item }} paver update_assets {{ item }} --settings=aws
executable=/bin/bash
chdir={{ edxapp_code_dir }}
sudo_user
:
"
{{
edxapp_user
}}"
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
notify
:
-
"
restart
edxapp"
-
"
restart
edxapp_workers"
environment
:
"
{{
edxapp_environment
}}"
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-cms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py cms migrate --noinput --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-lms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py lms migrate --noinput --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-runserver-cms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py cms runserver {{ edxapp_cms_gunicorn_port }} --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-runserver-lms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py lms runserver {{ edxapp_lms_gunicorn_port }} --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-shell-cms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py cms shell --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-shell-lms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py lms shell --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-syncdb-cms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py cms syncdb --migrate --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-syncdb-lms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin}}/python manage.py lms syncdb --migrate --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets-cms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin }}/paver update_assets cms --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets-lms.j2
0 → 100644
View file @
05b6439b
{% include "edxapp_common.j2" %}
sudo -E -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin }}/paver update_assets lms --settings $EDX_PLATFORM_SETTINGS
playbooks/roles/edxapp/templates/edx/bin/edxapp_common.j2
0 → 100644
View file @
05b6439b
#!/bin/bash
cd
{{
edxapp_code_dir
}}
source
{{
edxapp_app_dir
}}
/edxapp_env
# The default settings set in edxapp_env can be overridden
# using the var $EDX_PLATFORM_SETTINGS_OVERRIDE
if
[[
-n
"
$EDX_PLATFORM_SETTINGS_OVERRIDE
"
]]
;
then
export
EDX_PLATFORM_SETTINGS
=
"
$EDX_PLATFORM_SETTINGS_OVERRIDE
"
fi
playbooks/roles/supervisor/tasks/main.yml
View file @
05b6439b
...
...
@@ -138,22 +138,32 @@
mode=0644
-
name
:
create a symlink for supervisortctl
# these links are deprecated in favor of the shell wrapper
file
:
>
src={{ supervisor_ctl }}
dest={{ COMMON_BIN_DIR }}/{{ supervisor_ctl|basename }}
state=
link
state=
absent
when
:
supervisor_service == "supervisor"
-
name
:
create a symlink for supervisor cfg
# these links are deprecated in favor of the shell wrapper
file
:
>
src={{ item }}
dest={{ COMMON_CFG_DIR }}/{{ item|basename }}
state=
link
state=
absent
when
:
supervisor_service == "supervisor"
with_items
:
-
"
{{
supervisor_cfg
}}"
-
"
{{
supervisor_cfg_dir
}}"
-
name
:
create helper script for running supervisor
template
:
>
src=edx/bin/supervisorctl.j2
dest={{ COMMON_BIN_DIR }}/supervisorctl
owner={{ supervisor_service_user }}
mode=0755
when
:
supervisor_service == "supervisor"
-
name
:
start supervisor
service
:
>
name={{ supervisor_service }}
...
...
playbooks/roles/supervisor/templates/edx/bin/supervisorctl.j2
0 → 100644
View file @
05b6439b
#!/bin/bash
sudo
-u
{{
supervisor_service_user
}}
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
$*
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