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:
13
ansible/inventory/group_vars/all.yml
Normal file
13
ansible/inventory/group_vars/all.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# Global configuration
|
||||
|
||||
# SSH defaults
|
||||
ssh_user: "rocky"
|
||||
|
||||
# Default image password
|
||||
default_image_password: "rocky"
|
||||
|
||||
# Rocky Linux image URLs
|
||||
rocky9_qcow2_url: "https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2"
|
||||
rocky8_qcow2_url: "https://download.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud-Base.latest.x86_64.qcow2"
|
||||
qcow2_url: "{{ rocky9_qcow2_url }}"
|
||||
29
ansible/inventory/group_vars/aws.yml
Normal file
29
ansible/inventory/group_vars/aws.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# AWS provider-specific configuration
|
||||
# TODO: Implement AWS-specific settings
|
||||
|
||||
# Provider identification
|
||||
provider: aws
|
||||
|
||||
# AWS-specific variables (to be implemented)
|
||||
# aws_region: "us-east-1"
|
||||
# aws_instance_type: "t3.medium"
|
||||
# aws_vpc_id: ""
|
||||
# aws_subnet_id: ""
|
||||
# aws_security_group_id: ""
|
||||
|
||||
# Rocky Linux AMI IDs (to be populated)
|
||||
# rocky9_ami: "ami-xxxxxxxxx" # Rocky 9 AMI for your region
|
||||
# rocky8_ami: "ami-xxxxxxxxx" # Rocky 8 AMI for your region
|
||||
|
||||
# Default AMI (override with -e "ami_id=ami-xxx")
|
||||
# ami_id: "{{ rocky9_ami }}"
|
||||
|
||||
# Instance settings
|
||||
# instance_name_prefix: "test"
|
||||
# instance_tags:
|
||||
# Environment: "testing"
|
||||
# ManagedBy: "ansible"
|
||||
|
||||
# Note: AWS does not require golden image creation
|
||||
# Workflow: Select AMI -> Launch instance -> Run Sparrowdo tests -> Terminate
|
||||
36
ansible/inventory/group_vars/azure.yml
Normal file
36
ansible/inventory/group_vars/azure.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
# Azure provider-specific configuration
|
||||
# TODO: Implement Azure-specific settings
|
||||
|
||||
# Provider identification
|
||||
provider: azure
|
||||
|
||||
# Azure-specific variables (to be implemented)
|
||||
# azure_location: "eastus"
|
||||
# azure_resource_group: ""
|
||||
# azure_vm_size: "Standard_B2s"
|
||||
# azure_virtual_network: ""
|
||||
# azure_subnet: ""
|
||||
# azure_security_group: ""
|
||||
|
||||
# Rocky Linux image references (to be populated)
|
||||
# rocky9_image:
|
||||
# publisher: "resf"
|
||||
# offer: "rockylinux-9"
|
||||
# sku: "rockylinux-9"
|
||||
# version: "latest"
|
||||
|
||||
# rocky8_image:
|
||||
# publisher: "resf"
|
||||
# offer: "rockylinux-8"
|
||||
# sku: "rockylinux-8"
|
||||
# version: "latest"
|
||||
|
||||
# VM settings
|
||||
# vm_name_prefix: "test"
|
||||
# vm_tags:
|
||||
# Environment: "testing"
|
||||
# ManagedBy: "ansible"
|
||||
|
||||
# Note: Azure does not require golden image creation
|
||||
# Workflow: Select image -> Create VM -> Run Sparrowdo tests -> Delete VM
|
||||
21
ansible/inventory/group_vars/libvirt.yml
Normal file
21
ansible/inventory/group_vars/libvirt.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# Libvirt provider configuration
|
||||
|
||||
provider: libvirt
|
||||
|
||||
# Image directories
|
||||
images_dir: "/var/lib/libvirt/images"
|
||||
base_images_dir: "{{ images_dir }}/base"
|
||||
golden_images_dir: "{{ images_dir }}/golden"
|
||||
golden_image_path: "{{ golden_images_dir }}/rocky-golden.qcow2"
|
||||
|
||||
# Download settings
|
||||
force_download: false
|
||||
download_timeout: 1800
|
||||
|
||||
# Golden image settings
|
||||
root_password: "{{ default_image_password }}"
|
||||
|
||||
# VM settings
|
||||
vm_memory: 4096
|
||||
vm_vcpus: 4
|
||||
Reference in New Issue
Block a user