You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

79 lines
2.4 KiB

---
- name: apt-get install python3 python3-pip libyaml-dev curl
apt:
name: [ python3, python3-pip, libyaml-dev, curl ]
state: present
- name: pip install tutor-openedx
pip:
executable: pip3
name: tutor-openedx
- name: "mkdir -p {{ openedx_root }}"
file:
path: "{{ openedx_root }}"
state: directory
owner: debian
group: debian
- name: configure and create openedX
shell: |
set -ex
tutor config save --set ACTIVATE_HTTPS=false \
--set CMS_HOST=studio.{{ domain }} \
--set CONTACT_EMAIL='{{ openedx_contact }}' \
--set LANGUAGE_CODE={{ openedx_language }} \
--set LMS_HOST=openedx.{{ domain }} \
--set PLATFORM_NAME='{{ openedx_platform_name }}' \
--set NGINX_HTTP_PORT={{ openedx_port }} \
--set NGINX_HTTPS_PORT=8543 \
--set SMTP_HOST=openedx-host.{{ domain }} \
--set SMTP_PORt=25
if ! test -f {{ openedx_root }}/configured ; then
tutor local quickstart --non-interactive
tutor local createuser --staff --password '{{ openedx_password }}' --superuser '{{ openedx_user }}' '{{ openedx_contact }}'
touch {{ openedx_root }}/configured
else
tutor local start -d
fi
environment:
HOME: "{{ openedx_root }}"
become: False
- name: wait for openedx.{{ domain }} to be ready
shell: |
set $(curl -k -L -s --head https://openedx.{{ domain }} | grep HTTP | tail -1)
if test "$2" = 200 ; then
exit 0
else
exit 1
fi
register: openedx_get
until: openedx_get is success
retries: 20
delay: 5
- name: git clone https://github.com/overhangio/indigo
git:
repo: https://github.com/overhangio/indigo
force: yes
dest: "{{ openedx_root }}/indigo"
become: False
- name: install indigo theme
shell: |
set -ex
if ! test -f {{ openedx_root }}/themed ; then
tutor config render --extra-config ./indigo/config.yml ./indigo/theme "$(tutor config printroot)/env/build/openedx/themes/indigo"
tutor images build openedx
tutor local start -d
tutor local settheme indigo localhost studio.localhost \
$(tutor config printvalue LMS_HOST) $(tutor config printvalue CMS_HOST)
touch {{ openedx_root }}/themed
fi
args:
chdir: "{{ openedx_root }}"
environment:
HOME: "{{ openedx_root }}"
become: False