-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Linux] Improve check_os_fullname test case to check guest id and gue…
…st family (#419) * [Linux] Improve check_os_fullname test case to check guest id and guest family Signed-off-by: Qi Zhang <[email protected]>
- Loading branch information
1 parent
5f80f1f
commit ebca3b3
Showing
33 changed files
with
527 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
# Copyright 2022-2023 VMware, Inc. | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
--- | ||
# Map AlmaLinux when ESXi version > 7.0.3 and VMware Tools version > 11.3.5 | ||
- name: "Set guest_fullname variable for AlmaLinux on ESXi 7.0.3 later and VMTools 11.3.5 later" | ||
# Guest id "almalinux_64Guest and full name "AlmaLinux (64-bit)" is available on ESXi 8.0.0 or later | ||
# Guest full name of AlmaLinux is mapped to "AlmaLinux (64-bit)" when | ||
# VMware Tools version is 12.0.0 or later, ESXi version is 8.0.0 or later. | ||
- name: "Set expected guest id and full name for AlmaLinux with VMware Tools {{ vmtools_version }} on ESXi {{ esxi_version }}" | ||
ansible.builtin.set_fact: | ||
guest_fullname: "AlmaLinux ({{ guest_os_bit }})" | ||
expected_guest_id: "almalinux_64Guest" | ||
expected_guest_fullname: "AlmaLinux (64-bit)" | ||
when: | ||
- esxi_version is version('7.0.3', '>') | ||
- vmtools_version is version('11.3.5', '>') | ||
- vmtools_version is version('12.0.0', '>=') | ||
- esxi_version is version('8.0.0', '>=') | ||
|
||
# Map AlmaLinux when ESXi version <= 7.0.3 or VMware Tools version <= 11.3.5 | ||
- name: "Set guest_fullname variable for AlmaLinux on ESXi 7.0.3 and earlier, or VMTools 11.3.5 and earlier" | ||
# Guest full name of AlmaLinux is mapped to VM's guest OS version when: | ||
# VMware Tools version is 12.0.0 or later, ESXi version is 7.0.3 or earlier. | ||
- name: "Set expected guest id and full name for AlmaLinux with VMware Tools {{ vmtools_version }} on ESXi {{ esxi_version }}" | ||
ansible.builtin.set_fact: | ||
expected_guest_id: "{{ vm_guest_id }}" | ||
expected_guest_fullname: "{{ vm_guest_os_version }}" | ||
when: | ||
- vmtools_version is version('12.0.0', '>=') | ||
- esxi_version is version('8.0.0', '<') | ||
|
||
# Guest full name of AlmaLinux is mapped to "Other N.x Linux (64-bit)" when | ||
# VMware Tools version is 11.3.5 or earlier | ||
- name: "Set expected guest id and full name for AlmaLinux with VMware Tools {{ vmtools_version }} on ESXi {{ esxi_version }}" | ||
include_tasks: otherlinux_fullname_map.yml | ||
when: > | ||
esxi_version is version('7.0.3', '<=') or | ||
vmtools_version is version('11.3.5', '<=') | ||
when: vmtools_version is version('12.0.0', '<') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
--- | ||
# Guest id "amazonlinux2_64Guest" and full name "Amazon Linux 2 (64-bit)" is available on ESXi 6.7 U1 or later | ||
# Guest id "amazonlinux3_64Guest" and full name "Amazon Linux 3 (64-bit)" is available on ESXi 7.0.1 or later | ||
- name: "Set fact of expected guest OS major version on ESXi {{ esxi_version }}" | ||
ansible.builtin.set_fact: | ||
expected_guest_major_ver: |- | ||
{%- if (esxi_version is version('6.7.0', '>') and esxi_version is version('7.0.1', '<')) or | ||
(esxi_version is version('6.7.0', '==') and esxi_update_version | int > 0) -%} | ||
{{ [guest_os_ansible_distribution_major_ver | int, 2] | min }} | ||
{%- elif esxi_version is version('7.0.1', '>=') -%} | ||
{{ [guest_os_ansible_distribution_major_ver | int, 3 ] | min }} | ||
{%- endif %} | ||
- name: "Set expected guest id and full name for Amazon Linux on ESXi {{ esxi_version }}" | ||
ansible.builtin.set_fact: | ||
expected_guest_id: "amazonlinux{{ expected_guest_major_ver }}_64Guest" | ||
expected_guest_fullname: "Amazon Linux {{ expected_guest_major_ver }} (64-bit)" | ||
when: expected_guest_major_ver |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,22 @@ | ||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
--- | ||
# Map CentOS when ESXi < 6.5.0 | ||
- name: Set guest_fullname variable for CentOS on ESXi < 6.5.0 | ||
# Guest id "centos7_64Guest" and full name "CentOS 7 (64-bit)" is available on ESXi 6.5 or later | ||
# Guest id "centos8_64Guest" and full name "CentOS 8 (64-bit)" is available on ESXi 6.7 or later | ||
# Guest id "centos9_64Guest" and full name "CentOS 9 (64-bit)" is available on ESXi 7.0.1 or later | ||
- name: "Set fact of expected guest OS major version on ESXi {{ esxi_version }}" | ||
ansible.builtin.set_fact: | ||
guest_fullname: "CentOS 4/5 or later ({{ guest_os_bit }})" | ||
when: esxi_version is version('6.5.0', '<') | ||
expected_guest_major_ver: |- | ||
{%- if esxi_version is version('6.5.0', '>=') and esxi_version is version('6.7.0', '<') -%} | ||
{{ [guest_os_ansible_distribution_major_ver | int, 7 ] | min }} | ||
{%- elif esxi_version is version('6.7.0', '>=') and esxi_version is version('7.0.1', '<') -%} | ||
{{ [guest_os_ansible_distribution_major_ver | int, 8 ] | min }} | ||
{%- elif esxi_version is version('7.0.1', '>=') -%} | ||
{{ [guest_os_ansible_distribution_major_ver | int, 9 ] | min }} | ||
{%- endif %} | ||
# Map CentOS-5 and earlier when ESXi >= 6.5.0 | ||
- name: Set guest_fullname variable for CentOS on ESXi >= 6.5.0 | ||
- name: "Set expected guest id and full name for CentOS on ESXi {{ esxi_version }}" | ||
ansible.builtin.set_fact: | ||
guest_fullname: "CentOS {{ guest_os_ansible_distribution_major_ver }} ({{ guest_os_bit }})" | ||
when: | ||
- guest_os_ansible_distribution_major_ver | int <= 5 | ||
- esxi_version is version('6.5.0', '>=') | ||
|
||
# Map CentOS-6, CentOS-7 when ESXi = 6.5.0 | ||
- name: Set guest_fullname variable for CentOS on ESXi = 6.5.0 | ||
ansible.builtin.set_fact: | ||
guest_fullname: "CentOS {{ guest_os_ansible_distribution_major_ver }} ({{ guest_os_bit }})" | ||
when: | ||
- guest_os_ansible_distribution_major_ver | int == 6 or guest_os_ansible_distribution_major_ver | int == 7 | ||
- esxi_version is version('6.5.0', '==') | ||
|
||
# Map CentOS-8 and later when ESXi = 6.5.0 | ||
- name: Set guest_fullname variable for CentOS on ESXi = 6.5.0 | ||
ansible.builtin.set_fact: | ||
guest_fullname: "CentOS 7 ({{ guest_os_bit }})" | ||
when: | ||
- guest_os_ansible_distribution_major_ver | int >= 8 | ||
- esxi_version is version('6.5.0', '==') | ||
|
||
# Map CentOS-6 and later when ESXi >= 6.7.0 | ||
- name: Set guest_fullname variable for CentOS on ESXi >= 6.7.0 | ||
ansible.builtin.set_fact: | ||
guest_fullname: "CentOS {{ guest_os_ansible_distribution_major_ver }} ({{ guest_os_bit }})" | ||
when: | ||
- guest_os_ansible_distribution_major_ver | int >= 6 | ||
- esxi_version is version('6.7.0', '>=') | ||
expected_guest_id: "centos{{ expected_guest_major_ver }}{{ expected_guest_id_suffix }}" | ||
expected_guest_fullname: "CentOS {{ expected_guest_major_ver }} ({{ guest_os_bit }})" | ||
when: expected_guest_major_ver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.