Commit 4609e758 by John Jarvis

adding role for importing the demo course

parent 5b2f2e2d
---
# Creates a new ansible role
# Usage:
# ansible-playbook -c local --limit "localhost," ./create_role.yml -i "localhost," -e role_name=my_awesome_role
#
- hosts: localhost
gather_facts: False
roles:
- ansible-role
......@@ -19,6 +19,8 @@
- supervisor
- mongo
- edxapp
- role: demo
tags: ['demo']
- { role: 'rabbitmq', rabbitmq_ip: '127.0.0.1' }
- { role: 'edxapp', celery_worker: True }
- oraclejdk
......
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role demo
#
#
# vars are namespace with the module name.
#
demo_app_dir: "{{ COMMON_APP_DIR }}/demo"
demo_code_dir: "{{ demo_app_dir }}/edx-demo-course"
demo_repo: "https://{{ COMMON_GIT_MIRROR }}/edx/edx-demo-course.git"
demo_version: "master"
#
# OS packages
#
demo_debian_pkgs: []
demo_redhat_pkgs: []
---
- name: demo | check out the demo course
git: dest={{ demo_code_dir }} repo={{ demo_repo }} version={{ demo_version }}
sudo_user: "{{ edxapp_user }}"
register: demo_checkout
tags: deploy
- name: demo | import demo course
shell: >
{{ edxapp_venv_bin }}/python ./manage.py cms --settings=aws import {{ edxapp_course_data_dir }} {{ demo_code_dir }}
chdir={{ edxapp_code_dir }}
sudo_user: "{{ common_web_user }}"
tags: deploy
when: demo_checkout.changed
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role demo
#
# Overview:
#
# Imports the demo course into studio
# https://github.com/edx/edx-demo-course
#
# Once imported this role will only re-import the course
# if the edx-demo-course repo has been updated
#
# Dependencies:
# - common
# - edxapp
#
# Example play:
#
# roles:
# - common
# - edxapp
# - demo
- name: demo | create demo app and data dirs
file: >
path="{{ demo_app_dir }}" state=directory
owner="{{ edxapp_user }}" group="{{ common_web_group }}"
- include: deploy.yml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment