From 6c962ef49952ec6f89c7013caaf9b190b6fbae48 Mon Sep 17 00:00:00 2001 From: ZouYuhua Date: Thu, 13 Jun 2024 15:20:22 +0800 Subject: [PATCH 1/3] fix ovt_verify_pkg_install issue for opensusu Signed-off-by: ZouYuhua --- linux/setup/reconfig_existing_guest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/setup/reconfig_existing_guest.yml b/linux/setup/reconfig_existing_guest.yml index 9aba4d1b2..3905ae189 100644 --- a/linux/setup/reconfig_existing_guest.yml +++ b/linux/setup/reconfig_existing_guest.yml @@ -40,8 +40,8 @@ package_list: ["gawk", "python3-rpm", "tar"] package_state: "present" -- name: "Reconfigure SLED" - when: guest_os_ansible_distribution == "SLED" +- name: "Reconfigure {{ guest_os_ansible_distribution }}" + when: guest_os_family == "Suse" block: - name: "Check 'PackageKit' service state" include_tasks: ../utils/get_service_info.yml From 6ba74a3ca3ae442d6c655df71965eafbdacc13ff Mon Sep 17 00:00:00 2001 From: ZouYuhua Date: Fri, 14 Jun 2024 10:24:13 +0800 Subject: [PATCH 2/3] fix undefined variable Signed-off-by: ZouYuhua --- linux/open_vm_tools/uninstall_ovt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/open_vm_tools/uninstall_ovt.yml b/linux/open_vm_tools/uninstall_ovt.yml index 5ab720f80..05247b680 100644 --- a/linux/open_vm_tools/uninstall_ovt.yml +++ b/linux/open_vm_tools/uninstall_ovt.yml @@ -24,7 +24,7 @@ - ovt_uninstall_result.stdout - ovt_uninstall_result.rc is defined - ovt_uninstall_result.rc | int == 0 - fail_msg: "Failed to uninstall open-vm-tools by executing command: {{ ' '.join(ovt_uninstall_result.cmd) }}" + fail_msg: "Failed to uninstall open-vm-tools by executing command: {{ package_uninstall_cmd }} {{' '.join(ovt_packages) }}" - name: "Reboot VM to make changes take effect" include_tasks: ../utils/reboot.yml From bb085c8d1021a4e3fa9abb21298d197d4ec4d447 Mon Sep 17 00:00:00 2001 From: ZouYuhua Date: Fri, 14 Jun 2024 11:13:31 +0800 Subject: [PATCH 3/3] change code as codereview Signed-off-by: ZouYuhua --- linux/open_vm_tools/uninstall_ovt.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/open_vm_tools/uninstall_ovt.yml b/linux/open_vm_tools/uninstall_ovt.yml index 05247b680..fb706aec0 100644 --- a/linux/open_vm_tools/uninstall_ovt.yml +++ b/linux/open_vm_tools/uninstall_ovt.yml @@ -7,7 +7,7 @@ # # Uninstall open-vm-tools packages - name: "Uninstall packages {{ ovt_packages }}" - ansible.builtin.command: "{{ package_uninstall_cmd }} {{' '.join(ovt_packages) }}" + ansible.builtin.command: "{{ package_uninstall_cmd }} {{ ' '.join(ovt_packages) }}" register: ovt_uninstall_result ignore_errors: true delegate_to: "{{ vm_guest_ip }}" @@ -24,7 +24,7 @@ - ovt_uninstall_result.stdout - ovt_uninstall_result.rc is defined - ovt_uninstall_result.rc | int == 0 - fail_msg: "Failed to uninstall open-vm-tools by executing command: {{ package_uninstall_cmd }} {{' '.join(ovt_packages) }}" + fail_msg: "Failed to uninstall open-vm-tools by executing command: {{ package_uninstall_cmd }} {{ ' '.join(ovt_packages) }}" - name: "Reboot VM to make changes take effect" include_tasks: ../utils/reboot.yml