Skip to content

Commit a86034a

Browse files
committed
matched OS info is list
Signed-off-by: dw035535 <diane.wang@broadcom.com>
1 parent f6c9179 commit a86034a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

windows/check_os_fullname/check_os_fullname.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,22 @@
3838
ansible.builtin.set_fact:
3939
current_gos: "{{ guest_os_ansible_distribution.strip('Microsoft ') }}"
4040

41-
- name: "Get the current OS info in the pre-defined guest OS info list"
41+
- name: "Get OS info in the pre-defined guest OS info list matched current OS"
4242
ansible.builtin.set_fact:
4343
current_gos_info: "{{ win_gos_info | selectattr('win_guest', 'equalto', current_gos) }}"
4444

4545
- name: "Check current OS in the pre-defined guest OS info list"
4646
ansible.builtin.assert:
4747
that:
48-
- current_gos_info
48+
- current_gos_info | length == 1
4949
fail_msg: >
5050
"The pre-defined guest OS info list does not contain this OS version: {{ current_gos }},
5151
please check whether this guest OS is supported and add it to the list accordingly."
5252
53+
- name: "Set fact of the matched current OS info"
54+
ansible.builtin.set_fact:
55+
current_gos_info: "{{ current_gos_info[0] }}"
56+
5357
- name: "Handle Windows 11 known issue"
5458
include_tasks: win11_guest_info_exception.yml
5559

0 commit comments

Comments
 (0)