Skip to content

Commit 51a2024

Browse files
committed
first commit
0 parents  commit 51a2024

File tree

427 files changed

+25414
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+25414
-0
lines changed

CONTRIBUTING.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Contributing to ansible-vsphere-gos-validation
2+
The "ansible-vsphere-gos-validation" project team welcomes contributions from the community. Before you start working with this project, please read our [Developer Certificate of Origin](https://cla.vmware.com/dco). All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch.
3+
4+
## Contribution flow
5+
### Creating issues
6+
It's better that each pull requrest corresponding to a filed issue.
7+
* Search the existing issues to see if there is same issue filed already,
8+
* File a new issue if there is no filed issue described the same problem as you meet,
9+
* Or file a new feature request if you want to add a new feature in this project.
10+
11+
### Creating pull requests
12+
This is a rough outline of what a contributor's workflow looks like:
13+
* Fork your own copy of this project to your account and clone it to your computer,
14+
* Create a topic branch from the development branch,
15+
* Make commits of logical units,
16+
* Make sure your commit messages are in the proper format (see below),
17+
* Push your changes to a topic branch in your forked repository,
18+
* Create a pull request.
19+
Example:
20+
```
21+
git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
22+
git remote add upstream https://github.com/vmware/ansible-vsphere-gos-validation.git
23+
git checkout -b my-new-feature master
24+
git commit -a
25+
git push origin my-new-feature
26+
```
27+
28+
### Staying in sync with upstream
29+
When your branch gets out of sync with the master branch, use the following to update:
30+
```
31+
git checkout my-new-feature
32+
git fetch -a
33+
git pull --rebase upstream master
34+
git push --force-with-lease origin my-new-feature
35+
```
36+
37+
### Updating pull requests
38+
If your PR fails to pass CI or needs changes based on code review, you'll most likely want to squash these changes into existing commits.
39+
If your pull request contains a single commit or your changes are related to the most recent commit, you can simply amend the commit.
40+
```
41+
git add .
42+
git commit --amend
43+
git push --force-with-lease origin my-new-feature
44+
```
45+
If you need to squash changes into an earlier commit, you can use:
46+
```
47+
git add .
48+
git commit --fixup <commit>
49+
git rebase -i --autosquash master
50+
git push --force-with-lease origin my-new-feature
51+
```
52+
Add a comment to the PR indicating your new changes are ready to review.
53+
54+
## Code style
55+
### Formatting commit messages
56+
We follow the conventions on [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/).
57+
Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits.

LICENSE.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ansible-vsphere-gos-validation
2+
Copyright 2021 VMware, Inc.
3+
4+
The BSD-2 license (the "License") set forth below applies to all parts of the ansible-vsphere-gos-validation project. You may not use this file except in compliance with the License.
5+
6+
BSD-2 License
7+
8+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9+
10+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
11+
12+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15+
16+
17+

NOTICE.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ansible-vsphere-gos-validation
2+
Copyright 2021 VMware, Inc.
3+
4+
This product is licensed to you under the BSD-2 license (the "License"). You may not use this product except in compliance with the BSD-2 License.
5+
6+
This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
7+

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Project for Guest OS Validation test on vSphere using Ansible
2+
3+
## Getting Started
4+
5+
### Prerequisites
6+
1. Install Ansible on your control machine, please refer to [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
7+
2. Install required Python libraries in requirements.txt
8+
3. Install required Ansible collections in requirements.yml
9+
4. Log in to local control machine as root or a user in sudoers
10+
11+
### Steps to Launch Testing
12+
1. Git clone project from github to your workspace on control machine,
13+
2. Set the parameters required for testing in this file: vars/test.yml,
14+
3. Modify the test cases in test case list file in below default path,
15+
* For Linux testing: linux/gosv_testcase_list.yml
16+
* For Windows testing: windows/gosv_testcase_list.yml
17+
4. Launch testing using below commands from the same path of "main.yml",
18+
```
19+
# For Linux testing:
20+
# you can use below command to use the default variables file "vars/test.yml",
21+
# default test case list file "linux/gosv_testcase_list.yml"
22+
ansible-playbook main.yml
23+
24+
# For Linux or Windows testing:
25+
# you can use below command to set the path of a customized variables file and
26+
# test case list file
27+
ansible-playbook main.yml -e "testing_vars_file=/path_to/test.yml testing_testcase_file=/path_to/gosv_testcase_list.yml"
28+
```
29+
30+
### Catalog
31+
* main.yml: Main playbook for Guest OS validation test
32+
* ansible.cfg: User customized Ansible configuration file
33+
* autoinstall: Folder for guest OS unattend install configuration files
34+
* common: Folder for common tasks called in test cases
35+
* docs: Folder for guide files
36+
* env_setup: Folder for playbooks or tasks which to prepare or cleanup testing environment
37+
* linux: Folder for playbooks to test Linux guest OS
38+
* Windows: Folder for playbooks to test Windows guest OS
39+
* plugin: Folder for plugin scripts
40+
* tools: Folder for 3rd-party tools used in test cases
41+
* vars: Folder for variable files used in testing
42+
* logs: Folder generated by default for files collected and logs generated in test run
43+
44+
### Supported Testing Scenarios
45+
This project supports below scenarios for end-to-end guest OS validation testing
46+
* Deploy VM and install guest OS from ISO image
47+
* Deploy VM from an OVA template
48+
* Existing VM with installed guest OS, which should satisfy below requirments.
49+
* SSH and Python are installed and enabled
50+
* The root user should be enabled and permitted to log in through SSH in Linux guest OS
51+
* Execute [ConfigureRemotingForAnsible.ps1](https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1) script in Windows guest OS in advance
52+
53+
### Supported Guest OS
54+
55+
| Guest OS types/versions | Automatic install from ISO image | Deploy from ova template | Existing VM and installed guest OS |
56+
| :---------------------------------------------- | :------------------------------: | :----------------------: | :--------------------------------: |
57+
| Red Hat Enterprise Linux 7.x, 8.x | :heavy_check_mark: | | :heavy_check_mark: |
58+
| CentOS 7.x, 8.x | :heavy_check_mark: | | :heavy_check_mark: |
59+
| Oracle Linux 7.x, 8.x | :heavy_check_mark: | | :heavy_check_mark: |
60+
| SUSE Linux Enterprise 15 SP2 | :heavy_check_mark: | | :heavy_check_mark: |
61+
| SUSE Linux Enterprise 12 SP5, 15 SP0/SP1 | | | :heavy_check_mark: |
62+
| Photon OS 3.x | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
63+
| Photon OS 4.0 | | :heavy_check_mark: | :heavy_check_mark: |
64+
| Ubuntu 18.04, 18.10, 20.04, 20.10 live-server | :heavy_check_mark: | | :heavy_check_mark: |
65+
| Ubuntu 20.04, 20.10 cloud image | | :heavy_check_mark: | :heavy_check_mark: |
66+
| Ubuntu 18.04, 18.10, 20.04, 20.10 desktop | | | :heavy_check_mark: |
67+
| Flatcar 2592.0.0 and later | | :heavy_check_mark: | :heavy_check_mark: |
68+
| Debian 9.x, 10.x | | | :heavy_check_mark: |
69+
| Windows 10 | :heavy_check_mark: | | :heavy_check_mark: |
70+
| Windows Server 2019 | :heavy_check_mark: | | :heavy_check_mark: |
71+

ansible.cfg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[defaults]
2+
callback_plugins = ./plugin
3+
# host_key_checking = False
4+
default_remote_user = root
5+
display_skipped_hosts = False
6+
remote_tmp = /tmp
7+
retry_files_enabled = False
8+
callback_whitelist = timer
9+
10+
# When Ansible version >= 2.10, and Ansible collections are not installed
11+
# in the default path, then set this parameter to the path of installed collections.
12+
# collections_paths = path_to_installed_collections
13+
14+
[ssh_connection]
15+
retries = 5

autoinstall/CentOS/7/ks.cfg

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#version=DEVEL
2+
# System authorization information
3+
auth --enableshadow --passalgo=sha512
4+
# Use CDROM installation media
5+
cdrom
6+
# Use graphical install
7+
graphical
8+
# Run the Setup Agent on first boot
9+
firstboot --enable
10+
ignoredisk --only-use=sda
11+
# Keyboard layouts
12+
keyboard --vckeymap=us --xlayouts='us'
13+
# System language
14+
lang en_US.UTF-8
15+
16+
# Network information
17+
network --bootproto=dhcp
18+
network --hostname=localhost.localdomain
19+
20+
# Root password
21+
rootpw --iscrypted $6$lFlujSLPNGocjpk6$0p3m.DXrs9gKhpKI4sLY.bSnSj9rqQN5gHgHgWC/aOABXZV1E6IU83aOnW4XIJKVb12cgn1w90cINnDxhdzWR1
22+
# System services
23+
services --enabled="chronyd"
24+
# System timezone
25+
timezone America/New_York --isUtc
26+
user --name=vmware --password=$6$z1H2Axdcrdy0K143$chi68XJ7faxJVto2WVmqwTdQ8Cfb4jd5KjJ8cRj0XLoyJmLxNXzZVvBKeAZIqjuuTugc5z02ImWM/W1CyuuS60 --iscrypted --gecos="vmware"
27+
28+
# X Window System configuration information
29+
xconfig --startxonboot
30+
# System bootloader configuration
31+
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
32+
autopart --type=lvm
33+
# Partition clearing information
34+
clearpart --none --initlabel
35+
36+
# Disable firewall
37+
services --disabled=firewalld
38+
eula --agreed
39+
40+
# Reboot when installation finished
41+
reboot
42+
43+
%packages
44+
@^graphical-server-environment
45+
@base
46+
@core
47+
@desktop-debugging
48+
@dial-up
49+
@fonts
50+
@gnome-desktop
51+
@guest-agents
52+
@guest-desktop-agents
53+
@hardware-monitoring
54+
@input-methods
55+
@internet-browser
56+
@multimedia
57+
@print-client
58+
@x11
59+
chrony
60+
kexec-tools
61+
open-vm-tools-desktop
62+
63+
%end
64+
65+
%addon com_redhat_kdump --enable --reserve-mb='auto'
66+
67+
%end
68+
69+
%anaconda
70+
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
71+
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
72+
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
73+
%end

autoinstall/CentOS/7/minimal/ks.cfg

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#version=DEVEL
2+
# System authorization information
3+
auth --enableshadow --passalgo=sha512
4+
# Use CDROM installation media
5+
cdrom
6+
# Use graphical install
7+
graphical
8+
# Run the Setup Agent on first boot
9+
firstboot --enable
10+
ignoredisk --only-use=sda
11+
# Keyboard layouts
12+
keyboard --vckeymap=us --xlayouts='us'
13+
# System language
14+
lang en_US.UTF-8
15+
16+
# Network information
17+
network --bootproto=dhcp
18+
network --hostname=localhost.localdomain
19+
20+
# Root password
21+
rootpw --iscrypted $6$6.fXe4ZAh1pQVE63$W4hCJwiSOG7ilGLsnBlRH/Z3buYWZmkgjBjvNqnpJ7jO5XmydeNGeD/tmXEEC/8WRpTxb6eWnzsSr9FtfnF9B/
22+
# System services
23+
services --enabled="chronyd"
24+
# System timezone
25+
timezone America/New_York --isUtc
26+
user --name=vmware --password=$6$3noAOuGuJaQmJ/Pm$kS/ul0M9l98RSeuWFYb3MKQfOtGWxIatxij0TkfQo9edjSlu1YBeQfdvBp.GpVVLj1oa9g0DVI.LFTWMK1OP// --iscrypted --gecos="vmware"
27+
# System bootloader configuration
28+
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
29+
autopart --type=lvm
30+
# Partition clearing information
31+
clearpart --none --initlabel
32+
33+
# Disable firewall
34+
services --disabled=firewalld
35+
eula --agreed
36+
37+
# Reboot when installation finished
38+
reboot
39+
40+
%packages
41+
@^minimal
42+
@core
43+
chrony
44+
kexec-tools
45+
46+
%end
47+
48+
%addon com_redhat_kdump --enable --reserve-mb='auto'
49+
50+
%end
51+
52+
%anaconda
53+
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
54+
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
55+
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
56+
%end
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#version=DEVEL
2+
# System authorization information
3+
auth --enableshadow --passalgo=sha512
4+
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability
5+
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage
6+
# Use CDROM installation media
7+
cdrom
8+
# Use graphical install
9+
graphical
10+
# Run the Setup Agent on first boot
11+
firstboot --enable
12+
ignoredisk --only-use=sda
13+
# Keyboard layouts
14+
keyboard --vckeymap=us --xlayouts='us'
15+
# System language
16+
lang en_US.UTF-8
17+
18+
# Network information
19+
network --bootproto=dhcp
20+
network --hostname=localhost.localdomain
21+
22+
# Root password
23+
rootpw --iscrypted $6$lFlujSLPNGocjpk6$0p3m.DXrs9gKhpKI4sLY.bSnSj9rqQN5gHgHgWC/aOABXZV1E6IU83aOnW4XIJKVb12cgn1w90cINnDxhdzWR1
24+
user --name=vmware --password=$6$z1H2Axdcrdy0K143$chi68XJ7faxJVto2WVmqwTdQ8Cfb4jd5KjJ8cRj0XLoyJmLxNXzZVvBKeAZIqjuuTugc5z02ImWM/W1CyuuS60 --iscrypted --gecos="vmware"
25+
26+
27+
# System services
28+
services --enabled="chronyd"
29+
# System timezone
30+
timezone America/New_York --isUtc
31+
# X Window System configuration information
32+
xconfig --startxonboot
33+
# System bootloader configuration
34+
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
35+
autopart --type=lvm
36+
# Partition clearing information
37+
clearpart --none --initlabel
38+
39+
#firewall --disable
40+
services --disabled=firewalld
41+
eula --agreed
42+
43+
# Reboot when the install is finished.
44+
reboot
45+
46+
47+
%packages
48+
@^graphical-server-environment
49+
@backup-server
50+
@base
51+
@core
52+
@desktop-debugging
53+
@development
54+
@dial-up
55+
@dns-server
56+
@file-server
57+
@fonts
58+
@ftp-server
59+
@gnome-desktop
60+
@guest-agents
61+
@guest-desktop-agents
62+
@hardware-monitoring
63+
@identity-management-server
64+
@input-methods
65+
@internet-browser
66+
@java-platform
67+
@kde-desktop
68+
@multimedia
69+
@network-file-system-client
70+
@performance
71+
@print-client
72+
@remote-system-management
73+
@system-admin-tools
74+
@virtualization-client
75+
@virtualization-tools
76+
@x11
77+
chrony
78+
kexec-tools
79+
open-vm-tools-desktop
80+
81+
%end
82+
83+
%addon com_redhat_kdump --enable --reserve-mb='auto'
84+
85+
%end
86+
87+
%anaconda
88+
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
89+
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
90+
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
91+
%end

0 commit comments

Comments
 (0)