Skip to main content
This guide covers advanced configuration options for Ralph, including LDAP/Active Directory authentication and OpenStack cloud synchronization.

Configuration Structure

Ubuntu Package Installation

Configuration files are located in /etc/ralph/:
  • /etc/ralph/ralph.conf - Main configuration
  • /etc/ralph/conf.d/database.conf - Database settings
  • /etc/ralph/conf.d/redis.conf - Redis cache settings
  • /etc/ralph/conf.d/gunicorn.conf - Gunicorn server settings
  • /etc/ralph/conf.d/cache.conf - Cache configuration
Settings are environment variables that Django reads on startup.

Docker Installation

Set environment variables in your docker-compose.yml file under the environment section.

LDAP Authentication

Ralph supports authentication via LDAP and Active Directory systems.

Installation

1

Install LDAP Requirements

Ubuntu:
Docker: LDAP dependencies are included in the base image.
2

Configure LDAP Backend

Add LDAP as an authentication backend in your local settings file.Create /etc/ralph/conf.d/ldap.conf (Ubuntu) or add to environment:

Active Directory Configuration

Example configuration for Active Directory:

OpenDJ Configuration

For OpenDJ LDAP servers, use uid for username:

LDAP Group Mapping

Map LDAP groups to Ralph permissions:

Nested LDAP Groups

For nested group support:

User Filtering

Restrict which LDAP users can access Ralph:
For OpenDJ, use isMemberOf instead of memberOf.

Synchronize Users

Sync LDAP users to Ralph database:
The script reports progress every 100 items.

ObjectClass Values by LDAP Implementation

  • Active Directory: objectClass=user
  • Novell eDirectory: objectClass=inetOrgPerson
  • OpenLDAP: objectClass=posixAccount

OpenStack Synchronization

Ralph supports one-way synchronization with OpenStack clouds, importing projects and instances in read-only mode.

Installation

1

Install OpenStack Requirements

Ubuntu:
Docker: OpenStack dependencies are included in the base Ralph image.
2

Configure OpenStack Instances

Add OpenStack configuration to your settings file.Create /etc/ralph/conf.d/openstack.conf or add to your local settings:
Configuration Parameters:
  • username: OpenStack user with permissions to list all projects and instances
  • tenant_name: Project/tenant for authentication
  • version: OpenStack API version (currently only 2.x supported)
  • auth_url: OpenStack Keystone API endpoint
  • tag: Tag added to all imported Cloud Projects and Cloud Hosts

Run Synchronization

Execute OpenStack sync manually:

Automated Synchronization

Schedule regular syncs using cron (Ubuntu):
For Docker, use a scheduler container or external cron job:

How It Works

  1. First Run: Imports all Cloud Projects, Cloud Hosts, and Cloud Flavors from OpenStack
  2. Subsequent Runs: Updates existing objects and deletes those no longer in OpenStack
  3. Read-Only Import: Most fields are read-only; only Service Environment, Tags, and Remarks can be modified
  4. Inheritance: Cloud Host service environments inherit from their parent Cloud Project

Database Configuration

MySQL Configuration

Ubuntu (/etc/ralph/conf.d/database.conf):
Docker (docker-compose.yml):

PostgreSQL Configuration

Ubuntu:

Redis Configuration

Ubuntu (/etc/ralph/conf.d/redis.conf):

Redis Sentinel (High Availability)

Gunicorn Configuration

Ubuntu (/etc/ralph/conf.d/gunicorn.conf):
Set GUNICORN_WORKERS to (2 * CPU_cores) + 1 for optimal performance.

Cache Configuration

Enable Redis caching for improved performance: Ubuntu (/etc/ralph/conf.d/cache.conf):

Logging Configuration

Ubuntu (/etc/ralph/ralph.conf):

Static Files and Media

After changing static file settings, collect static files:

Security Settings

Debug Mode

Never enable debug mode in production!

Allowed Hosts

For production, specify allowed hostnames:

Secret Key

Generate a unique secret key for your installation:
Add to configuration:

Applying Configuration Changes

After modifying configuration: Ubuntu:
Docker:

Next Steps

Data Migration

Learn how to import data from Ralph 2 or other sources