A simple template for building custom Ansible Execution Environments with ansible-builder
.
File | Purpose |
---|---|
execution-environment.yml |
Main ansible-builder configuration (UBI9 Python 3.12) |
requirements.txt |
Python dependencies (pip packages) |
requirements.yml |
Ansible Galaxy collections |
bindep.txt |
System packages (RPM/DEB) |
# Install tools
pip install ansible-builder ansible-navigator
# Build the execution environment
ansible-builder build -t my-ee:latest .
# Test it works
ansible-navigator exec --execution-environment-image my-ee:latest -- ansible --version
# Basic test - check collections
ansible-navigator exec --execution-environment-image my-ee:latest -- ansible-galaxy collection list
# Test with playbook
ansible-navigator run playbook.yml --execution-environment-image my-ee:latest
# Interactive mode to explore the environment
ansible-navigator exec --execution-environment-image my-ee:latest --mode interactive
3 Automated Workflows:
- Build: Uses
ansible-builder
with UBI9 Python 3.12 minimal base - Test: Validates Ansible functionality and collections
- Scan: Security vulnerability scanning with Trivy
- Publish: Pushes to GitHub Container Registry (GHCR)
- Artifacts: Generates SBOM for supply chain security
- Builds and tests without publishing
- Security scanning for early feedback
- Validates configuration files
- Semantic versioning with conventional commits
- Automatic changelog generation
- Tagged releases to GHCR (
latest
+ version tags)
See CONTRIBUTING.md for detailed guidelines.
MIT License - see LICENSE for details.