A Python tool to export Foreman/Red Hat Satellite configuration data via API.
- 📊 Export configuration from Foreman/Satellite servers
- 📝 Multiple output formats: Text (tab-separated) or HTML
- 🎨 Beautiful HTML reports with Foreman-inspired design
- 🌲 Dynamic hierarchical navigation tree (Organizations → Endpoints → Objects)
- 📈 Real-time progress bar with ETA
- 🔄 Comprehensive error handling
- 🌐 Automatic browser opening for HTML reports
- 📋 Click-to-copy table cells
- 🔍 Smooth scrolling navigation
- 📱 Responsive design
- Install dependencies:
pip install -r requirements.txtOr install individually:
pip install requests jinja2 tqdm./foremap.py --server https://satellite.example.com --username admin --password secret./foremap.py --server https://satellite.example.com --username admin --password secret --output html--server(required): Foreman/Satellite server URL (e.g., https://satellite.example.com)--username(required): Username for authentication--password(required): Password for authentication--output(optional): Output format -text(default) orhtml
- Tab-separated values printed to stdout
- Can be redirected to a file:
./foremap.py ... > output.txt - Easy to parse with other tools
- Modern Foreman-inspired design matching theforeman.org look & feel
- Fixed header with server information and metadata
- Left sidebar navigation with hierarchical tree structure:
- First level: Organizations
- Second level: Objects (grouped by endpoint)
- Expandable/collapsible tree nodes
- Active item highlighting
- Smooth scroll to sections
- Content area with clean, professional tables
- Interactive features:
- Click any table cell to copy its value
- Visual feedback on copy (orange highlight)
- Auto-scroll highlighting of current section
- Hash-based navigation (shareable URLs)
- Responsive design works on desktop and mobile
- Creates temporary directory in
/tmp/foremap_XXXXX/ - Includes
style.cssfor Foreman-style theming - Includes
foremap.jsfor all interactivity - Automatically opens in default browser
- Files preserved in
/tmp/for later viewing
foremap/
├── foremap.py # Main script
├── lib/
│ ├── __init__.py # Module init
│ └── endpoints.py # API endpoints configuration
├── templates/
│ ├── index.html.j2 # HTML page template
│ ├── error.text.j2 # Text error template
│ ├── error.html.j2 # HTML error template
│ ├── objects.text.j2 # Text objects template
│ ├── objects.html.j2 # HTML objects template
│ ├── style.css # CSS styling
│ └── foremap.js # JavaScript functionality
├── requirements.txt # Python dependencies
└── README.md # This file
Edit lib/endpoints.py to add/remove API endpoints or modify field configurations.
- Edit
templates/style.cssto change colors, fonts, layout - Edit
templates/foremap.jsto add interactive features - Edit
templates/*.j2to modify HTML structure
The tool includes comprehensive error handling:
- Connection errors: Checks server availability
- Timeout errors: Handles slow/unresponsive servers
- HTTP errors: Validates credentials
- Per-endpoint errors: Continues processing even if individual endpoints fail
./foremap.py --server https://satellite.lab.example.com --username admin --password P@ssw0rd --output html./foremap.py --server https://satellite.lab.example.com --username admin --password P@ssw0rd > satellite-config.txt- Python 3.6+
- Network access to Foreman/Satellite server
- Valid credentials with read access to API
Request classes based on: https://github.com/laspavel/foreman-api/
See project license file.