Implement Ansible roles for Rocky Linux Testing Framework

- Added `bootstrap_sparrowdo` role for bootstrapping Sparrowdo on a VM.
- Introduced `cleanup_vm` role for cleaning up VMs and disk images.
- Created `download_image` role to download and cache QCOW2 images.
- Developed `golden_image` role for creating and customizing golden images.
- Implemented `provision_vm` role for provisioning VMs as linked clones.
- Added `run_test` role for executing tests with Sparrowdo.
- Created playbooks for building golden images, running single tests, and running test suites.
- Enhanced documentation with usage examples, configuration details, and troubleshooting tips.
- Added support for multiple cloud providers (AWS, Azure) in the test execution workflow.

Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
Stephen Simpson
2025-12-29 16:02:39 -06:00
parent bb829c9b63
commit ec04f0bec5
46 changed files with 2005 additions and 2055 deletions

View File

@@ -108,30 +108,21 @@ sparrowdo --host $VM_IP --ssh_user rocky --no_sudo --sparrowfile test.raku
./scripts/cleanup_vm.sh test-vm-1
```
## Jenkins Pipeline Flow
## Workflow
The Jenkinsfile automatically handles bootstrap:
Bootstrap is handled automatically in the build process:
```groovy
stage('Prepare Golden Image') {
// Creates golden image with Raku/zef
setup_base.sh golden.qcow2 (with Raku)
}
1. **Prepare Golden Image**
- setup_base.sh → golden.qcow2 (with Raku)
stage('Bootstrap Golden Image') {
// Bootstraps Sparrowdo ONCE
bootstrap_golden.sh golden.qcow2 (with Sparrowdo)
}
2. **Bootstrap Golden Image**
- bootstrap_golden.sh → golden.qcow2 (with Sparrowdo)
stage('Run Tests') {
parallel {
test1: provision run test cleanup
test2: provision run test cleanup
test3: provision run test cleanup
// No bootstrap in any test!
}
}
```
3. **Run Tests in Parallel**
- provision → run test → cleanup
- provision → run test → cleanup
- provision → run test → cleanup
- (No bootstrap in any test!)
## Time Savings Example
@@ -272,7 +263,7 @@ The bootstrap script outputs:
If any step fails, the golden image is NOT bootstrapped. Check logs and retry.
## Integration with CI/CD
## Integration with Automation
### Nightly Golden Image Rebuild
```bash
@@ -287,10 +278,11 @@ If any step fails, the golden image is NOT bootstrapped. Check logs and retry.
# Provisions temp VM, runs one test, destroys
```
### Jenkins Scheduled Build
```groovy
// Rebuild golden images weekly
cron('H 2 * * 0') // Sunday 2 AM
### Scheduled Builds
Use your automation tool (cron, systemd timers, etc.) to rebuild golden images periodically:
```bash
# Weekly golden image rebuild
0 2 * * 0 /path/to/repo/ansible/playbooks/build-golden-image.yml
```
## Conclusion