The goal of the BluePlanetLife/edx-server-prep project is to provide a simple, but flexible way for anyone to prepare a server(s) for the installation of an instance of Open edX, especially when not using AWS or Vagrant..
The preparation is managed by Ansible and is intended for the use with edx/configuration.
Currently the playbook is created for the purpose of preparing an edx Ubuntu 12.04 64-bit single server installation as described on the edx/edx-platform wiki pages.
Now also supporting Backup and Restore playbooks. Note: For now this playbook only dumps and restores the MySQL containing Users and MongoDB containing Courses.
- Prepare Configuration Files
- Transfer the configuration from a local folder
- Clone configuration from a git repository
- Select an Open edX version
- release
- master
- named-release/birch (Named-Releases)
- System Settings
- Time Zone
- Locale
- Additional Packages
- htop
- Backup and Restore
- Backup to the the machine executing the playbook (can be set to localhost)
- Restore the backup just created
- Your previous backups will remain in the files/backups folder
- Ansible installed locally
- Remote (or VM) Ubuntu 12.04 64-bit Server to prepare
- Further requirements for Open edX
- Prepare your workstation
- install virtualenv
- activate that virtualenv
pip install ansible
within that virtualenv
- Clone
- Add an IP address to the
hosts
file, underneath[all]
.
- Use ip address of vagrant box if using vagrant
- Edit the file you want to use
- Edit
user: ubuntu
to match your user for SSH. Usevagrant
if using vagrant. - Define the hosts you want to have prepared (default:
all
)
- Edit
Playbook
andSystem
Variables in the 1. playbook (var: default
)
- Use a local configuration folder (
local_conf: False
) - Name of the local configuration folder (
config_folder: configuration
) - Repository for remote configuration (
config_repo: git@github.com:edx/configuration.git
) - Open edX version to clone from GitHub (
openedx_version: named-release/birch
). You may wantnamed-release/aspen
- Select your time zone (
timezone: Europe/Zurich
) - Set your locale settings (
locale: en_GB.UTF-8
)
(More information on Ansible Playbooks)
Open your command line interface and navigate to the cloned repository. After customizing your hosts and 1-ubuntu1204_single_server.yml file, run the following command:
ansible-playbook -i hosts 1-ubuntu1204_single_server.yml
If using vagrant, make sure vagrant
user has permissions to write to /home/vagrant/.ansible
folder.
sudo chown -R vagrant:vagrant /home/vagrant/.ansible
After customizing your hosts and backup/restore files, run the following command for a backup:
ansible-playbook -i hosts 98-db-backup.yml
or for Restore that backup
ansible-playbook -i hosts 99-db-restore.yml
! Custom Configuration ! In case you have a customized configuration, make sure to place it one the same folder level as this folder:
your_repos_folder
|--configuration-custom
|--preparation
|--...
Finally you can run the edx_sandbox.yml playbook, according to the wiki pages of edx/configuration:
cd /var/tmp/configuration/playbooks && sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost,"
This is a first script for simple and basic use and preparation. Further playbooks are planned for preparing different scenarios and constellations of Open edX instances.
Next up: Split Server Preparation For setting up two servers:
- App server
- DB server
Scripts follow the official Ansible Coding Conventions as well as the Ansible variable convention and overriding defaults, defined by and used for Open edX.