Skip to content

Director Setup

The director instance is used to run ansible playbooks in the openedx/configuration repo.

When we deploy an instance or an upgrade, we don't SSH directly into the server. Instead, we SSH to the director, and from director we SSH to the server we're deploying. This is done for security (the server only accepts SSH connections from director) and to offer us a stable environment with the right versions.

Requirements

Bootstrap the director instance by installing these packages:

1
2
3
4
5
# Install git, pip, and build libraries
sudo apt-get install git python-pip python-dev build-essential libssl-dev libffi-dev

# Install mysql client and dev packages
sudo apt-get install libmysqlclient-dev mysql-client

Set up python virtualenv:

1
2
3
4
5
6
sudo pip install virtualenv virtualenvwrapper
mkdir ~/virtualenvs
echo "export WORKON_HOME=~/virtualenvs" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
echo "export PIP_VIRTUALENV_BASE=~/virtualenvs" >> ~/.bashrc
source ~/.bashrc

Create and activate a python virtualenv to install the configuration dependencies:

1
mkvirtualenv edx-configuration

If you've already created the virtualenv in a previous step, then you can activate it using:

1
workon edx-configuration

Clone openedx/configuration repo, and install its python dependencies:

1
2
3
git clone https://github.com/openedx/configuration.git
cd configuration
make requirements

This will install ansible among other depencencies.

Upgrading director

A new openedx release can include a newer version of ansible or other Python packages. Because ansible playbooks are to be run from director, we must update the packages in director's virtualenv. To do so:

1
2
3
workon edx-configuration
cd configuration
make requirements

Last update: 2022-05-16