Skip to content

vmware/ansible-vsphere-gos-validation

Repository files navigation

Guest OS Validation on vSphere using Ansible

Getting Started

Prerequisites

  1. Install Ansible on your control machine, please refer to Installing Ansible
  2. Install required Python libraries in requirements.txt
$ pip install -r requirements.txt
  1. Install required Ansible collections in requirements.yml
$ ansible-galaxy install -r requirements.yml
  1. Log in to local control machine as root or a user in sudoers

Steps to Launch Testing

  1. Git clone project from github to your workspace on control machine,
  2. Set the parameters required for testing in this file: vars/test.yml,
  3. Modify the test cases in test case list file in below default path,
    • For Linux testing: linux/gosv_testcase_list.yml
    • For Windows testing: windows/gosv_testcase_list.yml
  4. Launch testing using below commands from the same path of "main.yml",
  # For Linux testing:
  # you can use below command to use the default variables file "vars/test.yml",
  # default test case list file "linux/gosv_testcase_list.yml"
  $ ansible-playbook main.yml

  # For Linux or Windows testing:
  # you can use below command to set the path of a customized variables file and
  # test case list file
  $ ansible-playbook main.yml -e "testing_vars_file=/path_to/test.yml testing_testcase_file=/path_to/gosv_testcase_list.yml"
  1. New folder for log files and files collected in test cases are created for current test run, e.g., "logs/test-vm/2021-07-06-09-27-51/", find test case results in "results.log", failed tasks in "failed_tasks.log", testing debug log in "full_debug.log".

Catalog

  • main.yml: Main playbook for Guest OS validation test
  • ansible.cfg: User customized Ansible configuration file
  • autoinstall: Folder for guest OS unattend install configuration files
  • common: Folder for common tasks called in test cases
  • docs: Folder for guide file and known issues
  • env_setup: Folder for playbooks or tasks which to prepare or cleanup testing environment
  • linux: Folder for playbooks to test Linux guest OS
  • windows: Folder for playbooks to test Windows guest OS
  • plugin: Folder for plugin scripts
  • tools: Folder for 3rd-party tools used in test cases
  • vars: Folder for variable files used in testing
  • changelogs: Folder for changelog of each release

Supported Testing Scenarios

This project supports below scenarios for end-to-end guest OS validation testing

  • Deploy VM and install guest OS from ISO image
  • Deploy VM from an OVA template
  • Existing VM with installed guest OS, which should satisfy below requirments.
    • SSH and Python are installed and enabled
    • The vm_python variable in vars/test.yml must be set with correct python path. Or user can set PATH in /etc/environment in guest OS to include the binary directory path to python.
    • The root user should be enabled and permitted to log in through SSH in Linux guest OS
    • Execute ConfigureRemotingForAnsible.ps1 script in Windows guest OS in advance

Supported Guest OS

Guest OS types/versions Automatic install from ISO image Deploy from ova template Existing VM and installed guest OS
Red Hat Enterprise Linux 7.x, 8.x, 9.x ✔️ ✔️
CentOS 7.x, 8.x ✔️ ✔️
Oracle Linux 7.x, 8.x ✔️ ✔️
Rocky Linux 8.4 ✔️ ✔️
AlmaLinux 8.4 ✔️ ✔️
SUSE Linux Enterprise 15 SP3, SP4 ✔️ ✔️
SUSE Linux Enterprise 12 SP5, 15 SP0/SP1/SP2 ✔️
Photon OS 3.x ✔️ ✔️ ✔️
Photon OS 4.x ✔️ ✔️ ✔️
Ubuntu 18.04, 18.10, 20.04, 20.10, 21.04, 21.10 live-server ✔️ ✔️
Ubuntu 20.04, 20.10, 21.04, 21.10 cloud image ✔️ ✔️
Ubuntu 18.04, 18.10, 20.04, 20.10, 21.04, 21.10 desktop ✔️
Flatcar 2592.0.0 and later ✔️ ✔️
Debian 9.x, 10.x ✔️
Astra Linux (Orel) 2.12.43 ✔️ ✔️
Windows 10, 11 ✔️ ✔️
Windows Server 2019, 2022 ✔️ ✔️
Windows Server SAC releases ✔️ ✔️

Note: This supported guest OS list is used for this project only. For guest OS support status on ESXi, please refer to VMware Compatibility Guide.

Docker images

  • Latest (Release v1.2):
    • projects.registry.vmware.com/gos_cert/ansible-vsphere-gos-validation:latest
  • Release v1.2:
    • projects.registry.vmware.com/gos_cert/ansible-vsphere-gos-validation:v1.2
  • Release v1.1:
    • projects.registry.vmware.com/gos_cert/ansible-vsphere-gos-validation:v1.1
  • Release v1.0:
    • projects.registry.vmware.com/gos_cert/ansible-vsphere-gos-validation:v1.0

Launch testing using Docker image

  1. Execute below commands in your machine
$ docker pull projects.registry.vmware.com/gos_cert/ansible-vsphere-gos-validation:latest
$ docker run -it --privileged projects.registry.vmware.com/gos_cert/ansible-vsphere-gos-validation:latest
  1. Launch testing in the started container following the steps in this section Steps to Launch Testing