This document describes how to set up and use the Foreman development environment that deploys Foreman source code directly on the VM while using containerized backend services.
The development environment provides:
- Git-based Foreman installation (cloned from GitHub)
- Containerized backend services (PostgreSQL, Redis, Candlepin, Pulp, Apache HTTP Server)
- Plugin support with registry system
- Development-specific configurations
- Direct Rails server access for debugging
- A running EL9 virtual machine, and inventory that contains knowledge of the VM. For example, using
./forge vms start.- CentOS Stream 9 is recommended and tested
- Other EL9 variants should work too. Please report if they do not.
- Run
./setup-environmentand activate the virtual environment
-
Start the development environment:
./forge deploy-dev
-
Access the environment:
- SSH into the VM:
vagrant ssh - Navigate to Foreman directory:
cd /home/vagrant/foreman - Start Rails server:
bundle exec foreman start
- SSH into the VM:
-
Access URLs:
- Foreman UI:
http://$(hostname -f):3000(development server) - Production-style UI:
https://$(hostname -f)(via Apache proxy)
- Foreman UI:
You can deploy directly to a remote host using the --target-host parameter:
# Deploy to a specific hostname or IP
./forge deploy-dev --target-host=my-server.example.com
# Deploy to an IP address
./forge deploy-dev --target-host=192.168.1.100When deploying to remote hosts that require SSH password authentication:
# Using environment variable
ANSIBLE_ASK_PASS=true ./forge deploy-dev --target-host=192.168.1.100Similarly to production deployments with foremanctl, using forge there is support for enabling hammer and foreman-proxy as features. Features can be enabled with --add-feature=$feature, which can be used multiple times.
By default hammer feature will set up hammer-cli and hammer-cli-foreman, foreman-proxy will set up smart-proxy itself. If any plugins are enabled, they're respective hammer or smart-proxy plugins will be set up as well.
All the projects set up as part of the feature are deployed as git checkouts.
katelloforeman_remote_execution
The system includes a plugin registry with predefined configurations:
katello- Katello subscription managementforeman_remote_execution- Remote execution pluginforeman_ansible- Ansible integrationforeman_rh_cloud- Red Hat Cloud integrationforeman_discovery- Host discoveryforeman_openscap- OpenSCAP complianceforeman_bootdisk- Boot disk creationforeman_openscap- Foreman plug-in for displaying OpenSCAP audit reportsforeman_theme_satellite- Branding for Satelliteforeman_tasks- Tasks management engine and plugin for Foremanforeman_webhooks- Call external webhooks from Foremanforeman_templates- A plugin for Foreman to sync provisioning templates from an external sourceforeman_leapp- A plugin that allows to run inplace upgrades for RHEL hosts in Foreman using Leapp tool.foreman_puppet- A plugin that adds Puppet External node classification functionality to Foreman.
Use the --foreman-development-enabled-plugin parameter (can be used multiple times):
# Enable specific plugins
./forge deploy-dev start --foreman-development-enabled-plugin katello --foreman-development-enabled-plugin foreman_ansible --foreman-development-enabled-plugin foreman_discovery
# Enable single plugin
./forge deploy-dev start --foreman-development-enabled-plugin katello
# Enable all available plugins
./forge deploy-dev start --foreman-development-enabled-plugin katello --foreman-development-enabled-plugin foreman_remote_execution --foreman-development-enabled-plugin foreman_ansible --foreman-development-enabled-plugin foreman_rh_cloud --foreman-development-enabled-plugin foreman_discovery --foreman-development-enabled-plugin foreman_openscap --foreman-development-enabled-plugin foreman_bootdiskAfter deployment, the environment includes:
- Cloned Foreman repository
- Installed Ruby and Node.js dependencies
- Database migrations and seeding
- Plugin repositories and configurations
- Development-specific settings
- if
hammerfeature was enabled,hammer-cliand its plugins - if
foreman-proxyfeature was enabledsmart-proxyand its plugins- the development smart proxy registered into Foreman
The development environment integrates:
- Apache HTTP Server: Provides HTTPS proxy to the Rails development server
- Backend Services: All services (PostgreSQL, Redis, Candlepin, Pulp) run in containers
- Rails Development Server: Runs directly on the VM for live debugging and development
- Pulp Smart Proxy Registration: Automatically configures Pulp integration during deployment
- Hammer CLI: Automatically sets up hammer for development, if
hammerfeature was enabled - Smart Proxy: Automatically set up a smart proxy for development and registers it into Foreman, if
foreman-proxyfeature was enabled
Development certificates are copied to /home/vagrant/foreman-certs/:
proxy_ca.pem- CA certificateclient_cert.pem- Client certificateclient_key.pem- Client private key