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
a023b3a1
Commit
a023b3a1
authored
May 07, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add XML tasks to new play.
parent
fd664911
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
playbooks/edx-east/update_xml_courses.yml
+65
-0
No files found.
playbooks/edx-east/update_xml_courses.yml
0 → 100644
View file @
a023b3a1
# Update all xml courses.
# Import any courses that are supposed to be imported.
# Drop any courses on disk that need to be dropped on disk.
#
# ansible-playbook -i <hostname>, update_xml_courses.yml -e@/path/to/secrets.yml
-
name
:
Make a zip of XML courses.
hosts
:
all
gather_facts
:
False
vars_files
:
-
roles/common/defaults/main.yml
-
roles/edxapp/defaults/main.yml
tasks
:
-
name
:
clone the xml course repo
git
:
>
repo="{{ item.repo_url }}"
dest="{{ edxapp_course_data_dir }}/{{ item.repo_name }}"
version="{{ item.version }}"
accept_hostkey=True
depth=1
sudo_user
:
"
{{
edxapp_user
}}"
environment
:
GIT_SSH
:
"
{{
edxapp_git_ssh
}}"
with_items
:
EDXAPP_XML_COURSES
-
name
:
update course.xml
template
:
>
src=course.xml.j2
dest="{{ edxapp_course_data_dir }}/{{ item.repo_name }}/course.xml"
sudo_user
:
"
{{
edxapp_user
}}"
with_items
:
EDXAPP_XML_COURSES
-
name
:
make symlinks for the static data
shell
:
>
executable=/bin/bash
if [[ -d {{ edxapp_course_data_dir }}/{{ item.repo_name }}/static ]]; then
ln -sf {{ edxapp_course_data_dir }}/{{ item.repo_name }}/static {{ edxapp_course_static_dir }}/{{ item.repo_name }}
else
ln -sf {{ edxapp_course_data_dir }}/{{ item.repo_name }} {{ edxapp_course_static_dir }}/{{ item.repo_name }}
fi
with_items
:
EDXAPP_XML_COURSES
when
:
item.disposition == "on disk" or item.disposition == "no static import"
-
name
:
import courses with nostatic flag
shell
:
>
{{ edxapp_venv_bin }}/python manage.py cms --settings=aws import --nostatic {{ edxapp_course_data_dir }} {{ item.repo_name }}
chdir="{{ edxapp_code_dir }}"
sudo_user
:
"
{{
edxapp_user
}}"
with_items
:
EDXAPP_XML_COURSES
when
:
item.disposition == "no static import"
-
name
:
import courses including static data
shell
:
>
{{ edxapp_venv_bin }}/python manage.py cms --settings=aws import {{ edxapp_course_data_dir }} {{ item.repo_name }}
chdir="{{ edxapp_code_dir }}"
sudo_user
:
"
{{
edxapp_user
}}"
with_items
:
EDXAPP_XML_COURSES
when
:
item.disposition == "import"
-
name
:
delete courses that were fully imported
file
:
path="{{ edxapp_course_data_dir }}/{{ item.repo_name }}" state=absent
with_items
:
EDXAPP_XML_COURSES
when
:
item.disposition == "import"
-
name
:
zip up the data and static dirs
shell
:
tar czf /tmp/static_course_content.tar.gz -C {{ edxapp_data_dir }} {{ edxapp_course_data_dir|basename }} {{ edxapp_course_static_dir|basename }}
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