A modern web-based interface for managing and executing Ansible playbooks with real-time monitoring and live execution output.
- Playbook Management: Create, edit, and organize Ansible playbooks
- Template System: Built-in templates and Jinja2 template support
- Inventory Management: Dynamic host and group management
- Real-time Execution: Live monitoring of playbook execution with streaming output
- Execution History: Track and review past playbook runs
- Unixy Callback Integration: Uses Ansible's
community.general.unixycallback for condensed, readable output - Color-Coded Output: Syntax highlighting for different Ansible output types:
- π’ OK/Success: Green highlighting
- π‘ Changed: Yellow highlighting
- π΄ Failed: Red highlighting with background
- π΅ Info: Blue for informational messages
- π£ Headers: Purple for PLAY/TASK headers
- βͺ Skipped: Gray for skipped tasks
- Responsive Design: Optimized for both desktop and mobile viewing
- Server-Sent Events: Real-time output streaming during execution
- Background Processing: Non-blocking playbook execution
- Error Handling: Comprehensive error reporting and recovery
- CORS Support: Cross-origin resource sharing enabled
- RESTful API: Clean API endpoints for all operations
- Python 3.8+
- Ansible 2.9+
community.generalcollection (automatically installed)
- Clone the repository:
git clone <repository-url>
cd ansible-admin- Install Python dependencies:
pip install -r requirements.txt- Install Ansible collections:
ansible-galaxy collection install -r requirements.yml- Start the server:
python3 server.py- Open your browser to
http://localhost:8000
The application uses a custom ansible.cfg file with the following settings:
[defaults]
stdout_callback = community.general.unixy
display_ok_hosts = true
display_skipped_hosts = true
show_task_path_on_failure = true
force_color = trueThe unixy callback provides:
- Condensed Output: More compact than default Ansible output
- Color Coding: Visual distinction between different output types
- Timing Information: Execution time for each task
- Host Status: Clear indication of success/failure per host
- Check Mode Support: Visual markers for dry-run mode
- Navigate to the Execute page
- Select a playbook from the dropdown or enter a custom path
- Configure inventory and target hosts
- Add any additional Ansible options
- Click Execute to start the playbook
- Monitor progress in real-time with color-coded output
- Built-in Templates: Pre-configured playbooks for common tasks
- Jinja2 Templates: Dynamic templates with variable substitution
- Custom Templates: Save and reuse your own templates
- Live Output: Real-time streaming of Ansible execution
- Status Indicators: Visual status badges (Running, Completed, Failed)
- Execution Timer: Track total execution time
- Auto-scroll: Automatically scroll to latest output
- Download Logs: Export execution logs for analysis
GET /api/list-playbooks- List available playbooksPOST /api/save-playbook- Save a playbookPOST /api/delete-playbook- Delete a playbook
GET /api/list-jinja-templates- List Jinja2 templatesGET /api/get-jinja-template?name=<name>- Get template content
POST /execute-playbook- Start playbook executionGET /execution-stream/<execution_id>- Stream execution outputPOST /cancel-execution- Cancel running execution
GET /get-execution-history- Get execution historyGET /execution-details/<execution_id>- Get detailed execution info
ansible-admin/
βββ server.py # Main HTTP server
βββ ansible.cfg # Ansible configuration with unixy callback
βββ requirements.yml # Ansible collection requirements
βββ execute.html # Playbook execution interface
βββ playbooks/ # Ansible playbooks directory
βββ templates/ # Jinja2 templates directory
βββ datastore/ # Data storage (JSON files)
βββ static/ # Static web assets
- Backend: Add new endpoints in
server.py - Frontend: Update HTML/JavaScript files
- Styling: Modify CSS for new UI elements
- Configuration: Update
ansible.cfgfor new Ansible settings
Unixy callback not working:
- Ensure
community.generalcollection is installed - Check that
ansible.cfgis in the project root - Verify ANSIBLE_CONFIG environment variable is set
Output not streaming:
- Check browser console for JavaScript errors
- Verify Server-Sent Events are supported
- Check server logs for connection issues
Color output not displaying:
- Ensure
force_color = truein ansible.cfg - Check terminal/browser color support
Enable verbose output by adding -vvv to Ansible options for detailed debugging.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Ansible - Automation framework
- community.general.unixy - Condensed output callback
- Bootstrap - UI framework
- Server-Sent Events - Real-time communication



