Complete rewrite of the module to deploy a Renovate bot for automated dependency management with Gitea integration. Breaking Changes: - Module purpose changed from Ansible EDA to Renovate bot - All variables restructured for Renovate configuration - State file path updated to home/docker/renovate/renovate.tfstate - Volumes changed from EDA rulebooks/logs to config/cache - Container image now uses renovate/renovate:latest Added: - Gitea platform integration with token authentication - Renovate configuration template (config.js.tpl) - Repository configuration examples - Gitea Actions workflow examples - SonarQube integration examples - Comprehensive documentation (README, QUICKSTART, MIGRATION_GUIDE) - CHANGELOG.md for version tracking - Security best practices Removed: - All Ansible EDA-specific configuration - Traefik labels (not needed for Renovate) - Old EDA documentation files - example-rulebook.yml Updated: - Complete README with Gitea setup instructions - terraform.tfvars with Renovate configuration - All resource names from ansible_eda to renovate - Backend state path This is version 2.0.0 - not backward compatible with previous EDA version. See MIGRATION_GUIDE.md for detailed migration instructions.
7.5 KiB
Migration Guide: Ansible EDA to Renovate
This document provides guidance for migrating from the previous Ansible EDA module to the new Renovate bot module.
Overview
This module has been completely repurposed from deploying Ansible Event-Driven Automation to deploying a Renovate bot for automated dependency updates. This is a breaking change and requires careful migration planning.
Key Changes
1. Module Purpose
Before: Ansible Event-Driven Automation (EDA) server for webhook-based automation After: Renovate bot for automated dependency updates
2. Docker Image
Before: quay.io/ansible/ansible-rulebook:latest
After: renovate/renovate:latest
3. Volumes
Before:
ansible-eda-rulebooks- Rulebook storageansible-eda-logs- Log storage
After:
renovate-config- Configuration storagerenovate-cache- Cache for improved performance
4. State File Path
Before: home/docker/ansible-eda/ansible-eda.tfstate
After: home/docker/renovate/renovate.tfstate
5. Variable Changes
Removed Variables
eda_image→ Userenovate_imageinsteadwebhook_port→ Not needed for Renovaterulebook_command→ Replaced by environment variablesupload_example_rulebook→ Useupload_config_fileinsteadcpu_limit→ Removed (can be added back if needed)
New Required Variables
renovate_endpoint- Gitea API endpoint (e.g.,https://gitea.example.com/api/v1/)renovate_token- Gitea personal access token for the bot
New Optional Variables
renovate_platform- Git platform (default: "gitea")renovate_git_author- Git commit authorrenovate_username- Bot usernamerenovate_autodiscover- Enable auto-discoveryrenovate_onboarding_config- Onboarding configurationgithub_com_token- Optional GitHub.com tokenrestart_policy- Container restart policyupload_config_file- Upload config.js template
6. Configuration Files
Before: example-rulebook.yml (YAML-based rulebooks)
After:
config.js.tpl- Renovate configuration templateexample-renovate.json- Repository-level configurationexample-gitea-workflow.yaml- CI/CD workflow example
Migration Steps
Option 1: Fresh Deployment (Recommended)
This is the safest approach if you don't need to preserve the existing infrastructure.
-
Backup Current State (if needed):
# Backup current state file terraform state pull > ansible-eda-backup.tfstate -
Destroy Old Infrastructure:
# Navigate to the module directory cd /path/to/terraform-docker-renovate # Destroy existing resources terraform destroy -
Update Configuration:
- Update
terraform.tfvarswith new variables - Add
renovate_endpointandrenovate_token - Remove old EDA-specific variables
- Update
-
Initialize and Deploy:
# Reinitialize (backend path has changed) terraform init -reconfigure # Plan and apply terraform plan terraform apply
Option 2: Side-by-Side Deployment
If you want to keep Ansible EDA running while testing Renovate:
-
Copy the Module:
cp -r terraform-docker-renovate terraform-docker-renovate-backup -
Deploy in New Location:
- Create a new module instance with a different
container_name - Use a different state file path
- Test Renovate functionality
- Create a new module instance with a different
-
Clean Up Old Deployment:
- Once satisfied, destroy the old Ansible EDA deployment
- Remove the backup module
Configuration Updates
terraform.tfvars
Before:
domain = "bsdserver.nl"
role_id = "xxx"
secret_id = "xxx"
After:
# Renovate Configuration
domain = "bsdserver.nl"
role_id = "xxx"
secret_id = "xxx"
# Gitea Configuration
renovate_endpoint = "https://gitea.bsdserver.nl/api/v1/"
renovate_token = "your-token-here"
renovate_git_author = "Renovate Bot <renovate-bot@bsdserver.nl>"
renovate_username = "renovate-bot"
Module Call
Before:
module "ansible_eda" {
source = "./terraform-docker-eda"
domain = "bsdserver.nl"
container_name = "ansible-eda"
eda_image = "quay.io/ansible/ansible-rulebook:latest"
webhook_port = 5000
role_id = var.vault_role_id
secret_id = var.vault_secret_id
}
After:
module "renovate" {
source = "./terraform-docker-renovate"
domain = "bsdserver.nl"
container_name = "renovate"
renovate_image = "renovate/renovate:latest"
renovate_endpoint = "https://gitea.bsdserver.nl/api/v1/"
renovate_token = var.renovate_token
role_id = var.vault_role_id
secret_id = var.vault_secret_id
}
Gitea Setup Requirements
Before deploying, ensure you have:
-
Created a Renovate Bot User in Gitea:
- Username:
renovate-bot(or your preference) - Full name: "Renovate Bot"
- Email:
renovate-bot@bsdserver.nl
- Username:
-
Generated a Personal Access Token with scopes:
repo(Read and Write)user(Read)issue(Read and Write) - Gitea ≥ 1.20.0organization(Read) - Gitea ≥ 1.20.0
-
Added Bot to Repositories:
- Add as collaborator to repositories you want to manage
- Or enable
renovate_autodiscover = trueto find all accessible repos
Post-Migration Tasks
After successful deployment:
-
Verify Container Status:
docker ps | grep renovate docker logs renovate -f -
Test Repository Configuration:
- Add
renovate.jsonto a test repository - Wait for Renovate to create an onboarding PR
- Review and merge the onboarding PR
- Add
-
Monitor Logs:
docker logs renovate -f -
Configure Scheduling:
- Set up cron job or Gitea Actions workflow
- See
files/example-gitea-workflow.yaml
Troubleshooting
State File Issues
If you encounter state file conflicts:
# Reinitialize with new backend configuration
terraform init -reconfigure
# Or migrate state if needed
terraform init -migrate-state
Container Won't Start
Check logs for authentication issues:
docker logs renovate
Common issues:
- Invalid Gitea endpoint (must end with
/api/v1/) - Incorrect or expired token
- Network connectivity to Gitea instance
Volume Migration
If you need to preserve any data (unlikely for this transition):
# Copy data from old volume to new
docker run --rm \
-v ansible-eda-rulebooks:/source:ro \
-v renovate-config:/dest \
alpine sh -c "cp -a /source/. /dest/"
Rollback Procedure
If you need to rollback to Ansible EDA:
-
Restore from Backup:
# Restore backup of terraform-docker-renovate module rm -rf terraform-docker-renovate cp -r terraform-docker-renovate-backup terraform-docker-renovate -
Destroy Renovate Resources:
terraform destroy -
Restore State:
terraform state push ansible-eda-backup.tfstate -
Redeploy:
terraform apply
Additional Resources
- Renovate Documentation
- Gitea Platform Configuration
- Self-Hosting Renovate
- Module README.md for complete documentation
Support
For issues or questions:
- Review the comprehensive README.md
- Check Renovate logs:
docker logs renovate - Consult the Renovate documentation
- Review the CHANGELOG.md for all changes