Welcome to the Ansible plugins for Backstage project! This repository provides plugins for backstage.io to deliver Ansible-specific user experiences in the developer portal, enabling self-service automation and integration with Ansible Automation Platform (AAP).
- Overview
- Features
- Prerequisites
- Getting Started
- Repository Structure
- Available Plugins
- Development
- Troubleshooting
- Documentation
- Contributing
- Security
- License
The Ansible Backstage Plugins project brings Ansible Automation Platform capabilities into Backstage, enabling developers to:
- Browse and launch job templates
- Manage inventories, projects, and credentials
- View job execution history and results
- Create self-service automation workflows
- Integrate AAP with software catalogs
- Generate scaffolder actions for AAP resources
This is a monorepo containing multiple plugins that work together to provide a comprehensive Ansible experience in Backstage.
- Frontend Integration: Browse resources directly in Backstage UI
- Self-Service Automation: Enable developers to trigger automations without AAP knowledge
- Catalog Integration: Sync AAP resources into Backstage catalog
- Scaffolder Actions: Create software templates that interact with AAP
- Authentication: Integrate AAP authentication with Backstage auth
- RBAC Support: Leverage AAP's role-based access control
- Dynamic Plugin Support: Deploy as dynamic plugins in Red Hat Developer Hub
Before setting up the development environment, ensure you have:
-
Node.js: Version 20 or 22 (LTS versions)
- Check version:
node --version - Install via nvm or from nodejs.org
- Check version:
-
Yarn: Version 4.9.2 (managed via Corepack)
- Corepack is included with Node.js 16.10+
- Enable Corepack:
corepack enable - Verify:
yarn --version
-
Git: For version control
- Check version:
git --version
- Check version:
- Operating System: Linux, macOS, or Windows with WSL2
- RAM: Minimum 8GB (16GB recommended for optimal build performance)
- Disk Space: At least 2GB free space for dependencies and build artifacts
-
Ansible Automation Platform: Access to an AAP instance for full functionality
- Version 2.4 or later recommended
- API access token with appropriate permissions
-
GitHub Account: For GitHub integration features
- Personal Access Token (PAT) with
reposcope
- Personal Access Token (PAT) with
- Clone the Repository
git clone https://github.com/ansible/ansible-backstage-plugins.git
cd ansible-backstage-plugins- Install Dependencies
Run the installation script to set up all dependencies:
./install-depsThis script will:
- Install Yarn 4.x via Corepack
- Install all workspace dependencies
- Set up Git hooks via Husky for pre-commit checks
Note: On systems with strict security policies, some native package builds may fail. This is usually acceptable as they're often optional dependencies.
- Verify Installation
Check that installation was successful:
# Check Node.js version
node --version # Should show v20.x.x or v22.x.x
# Check Yarn version
yarn --version # Should show 4.9.1 or similar
# Verify workspace structure
yarn workspaces listFor local development, create a local configuration file that won't be committed:
cp app-config.yaml app-config.local.yamlEdit app-config.local.yaml and update the following fields marked as changeme:
backend:
auth:
keys:
# Generate a secret with: openssl rand -base64 32
- secret: YOUR_SECRET_HEREintegrations:
github:
- host: github.com
# Create a token at: https://github.com/settings/tokens
# Required scopes: repo (for private repos) or public_repo (for public only)
token: ${GITHUB_TOKEN} # Or paste token directlyaap:
# Your Ansible Automation Platform instance URL
baseUrl: https://your-aap-instance.example.com
# AAP API token
# Create at: AAP UI → Users → Tokens → Add
token: ${AAP_TOKEN} # Or paste token directly
# SSL verification (set to true in production)
checkSSL: falseInstead of editing the config file, you can set environment variables:
# Create a .env file (this file is gitignored)
cat > .env << EOF
# Backend
BACKEND_SECRET=$(openssl rand -base64 32)
# GitHub Integration
GITHUB_TOKEN=ghp_your_token_here
# AAP Integration
AAP_BASE_URL=https://your-aap-instance.example.com
AAP_TOKEN=your-aap-token-here
AAP_CHECK_SSL=false
# Auth (for production)
AUTH_SIGNING_KEY=$(openssl rand -base64 32)
EOFAuthentication Providers
auth:
environment: development # Set to 'production' for production
providers:
github:
development:
clientId: ${AUTH_GITHUB_CLIENT_ID}
clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}yarn startThis will:
- Start the backend on
http://localhost:7007 - Start the frontend on
http://localhost:3000 - Enable hot module reloading for development
- Open your browser automatically
- First Launch: Initial compilation takes 2-3 minutes
- Browser Opens: Navigate to
http://localhost:3000 - Login: Use Guest login or configured auth provider
- Hot Reload: Changes to source files automatically reload
Normal startup logs include:
[0] info: Loaded config from app-config.yaml, app-config.local.yaml
[0] info: Created database connection
[1] info: Listening on :7007
[0] webpack compiled successfully
- Home:
http://localhost:3000 - Catalog:
http://localhost:3000/catalog - Ansible Plugin:
http://localhost:3000/ansible - Ansible Self-service Plugin:
http://localhost:3000/self-service(AAP Related) - API Docs:
http://localhost:7007/api/docs
ansible-backstage-plugins/
├── packages/ # Core Backstage application
│ ├── app/ # Frontend React application
│ └── backend/ # Backend Node.js service
│
├── plugins/ # Ansible-specific plugins
│ ├── backstage-rhaap/ # Provides access to the frontend plugin
│ ├── backstage-rhaap-common/ # Shared utilities and types
│ ├── auth-backend-module-rhaap-provider/ # Authentication provider
│ ├── catalog-backend-module-rhaap/ # Catalog integration
│ ├── scaffolder-backend-module-backstage-rhaap/ # Scaffolder actions
│ └── self-service/ # Self-service UI plugin
│
├── docs/ # Documentation
│ ├── features/ # Feature documentation
│ └── plugins/ # Plugin-specific docs
│
├── examples/ # Example configurations
│ ├── entities.yaml # Sample catalog entities
│ ├── org.yaml # Sample organization structure
│ └── template/ # Sample software template
│
├── app-config.yaml # Main configuration file
├── app-config.production.yaml # Production configuration
├── package.json # Root package.json with workspaces
├── tsconfig.json # TypeScript configuration
└── yarn.lock # Dependency lock file
Enables the Ansible sidebar option and provides access to the frontend plugin
Features:
- Ansible specific UI
- Allows to view ansible specific catalog information
- Allows to view and run ansible specific software templates
- Ansible related learning paths.
Self-service UI plugin for simplified automation access.
Features:
- Simplified job template interface
- Role-based view filtering
- Quick launch capabilities
Authentication provider for integrating AAP authentication with Backstage.
Catalog provider that syncs AAP resources into the Backstage catalog.
Syncs:
- Organizations
- Teams
- Users
- Projects
- Inventories
Scaffolder actions for creating software templates that interact with AAP.
Actions:
- Launch job templates
- Create projects
- Manage inventories
- Configure credentials
Shared utilities, types, and API clients used across all plugins.
# Run all tests once
yarn test
# Run tests in watch mode
yarn test:watch
# Run tests with coverage
yarn test:all# Test a specific plugin
yarn workspace @ansible/plugin-backstage-rhaap test
# Test with coverage
yarn workspace @ansible/plugin-backstage-rhaap test --coverage- Maintain >80% code coverage for all plugins
- Coverage reports are generated in
coverage/directory - View HTML report:
open coverage/lcov-report/index.html
# Type check
yarn tsc
# Build all packages
yarn build:allSolution: Some native packages (like esbuild) may fail in restricted environments. This is usually acceptable:
yarn install --immutable || echo "Some optional dependencies failed, continuing..."Solution: Increase Node.js memory:
export NODE_OPTIONS="--max-old-space-size=16384"
yarn build:allSolution: Either stop the conflicting process or use different ports:
# Find process using port
lsof -ti:3000 | xargs kill -9 # macOS/Linux
# Or configure different ports in app-config.local.yamlSolution: For development, disable SSL verification:
aap:
checkSSL: falseFor production, ensure proper SSL certificates are configured.
Solution: Verify token has correct scopes:
# Test token
curl -H "Authorization: token YOUR_TOKEN" https://api.github.com/userRequired scopes: repo (private repos) or public_repo (public only)
Solution: Clear build cache and rebuild:
yarn clean
yarn install
yarn build:all
yarn startSolution: Rebuild TypeScript declarations:
yarn tsc --build --clean
yarn tscIf you encounter issues:
- Check existing GitHub Issues
- Review plugin-specific README files
- Consult the Documentation
- Ask in GitHub Discussions
- Installation Guide: Deployment instructions
- Features Overview: Comprehensive feature documentation
- Frontend Plugin: AAP frontend integration
- Self-Service Plugin: Simplified automation UI
- Auth Provider: AAP authentication
- Catalog Module: Catalog integration
- Scaffolder Module: Scaffolder actions
We welcome contributions! Please see our Contributing Guide for details on:
- Code of Conduct
- Development workflow
- Coding standards
- Pull request process
- Testing requirements
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run
yarn lint:allandyarn test:all - Submit a pull request
For information on how releases are managed, see RELEASE_PROCESS.md.
For information about reporting security vulnerabilities, see SECURITY.md.
This project is licensed under the Apache License 2.0. See LICENSE for details.
By contributing to this project, you agree that your contributions will be licensed under the Apache License 2.0.
This project is actively maintained by the Ansible team at Red Hat. We appreciate all contributions and feedback from the community!
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ by the Ansible team