From be8d730d569b079df539816a3b6a13f795c7eb42 Mon Sep 17 00:00:00 2001 From: yanhuih2022 Date: Sun, 12 Mar 2023 18:06:45 +0800 Subject: [PATCH] Fix cloud-init GOSC test issues in Oracle Linux 8.7 and 9.1 Signed-off-by: yanhuih2022 --- .../linux_gosc_workflow.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/linux/guest_customization/linux_gosc_workflow.yml b/linux/guest_customization/linux_gosc_workflow.yml index 7ffb6e507..cf9740c5c 100644 --- a/linux/guest_customization/linux_gosc_workflow.yml +++ b/linux/guest_customization/linux_gosc_workflow.yml @@ -82,6 +82,31 @@ package_state: "present" when: guest_os_ansible_distribution != "VMware Photon OS" + # Need to install the latest cloud-init to Oracle Linux 8.7, 9.1 and pass the GOSC tests in Ansible + - name: "Install latest 'cloud-init' for cloud-init GOSC on {{ guest_os_ansible_distribution }}" + block: + - name: "Uninstall current cloud-init" + include_tasks: ../utils/install_uninstall_package.yml + vars: + package_list: ["cloud-init"] + package_state: "absent" + + - name: "Prepare cloud-init conf directory for new confs" + ansible.builtin.shell: | + if [ -e {{ "/etc/cloud" }} ] ; then + rm -rf {{ "/etc/cloud" }}; + fi + delegate_to: "{{ vm_guest_ip }}" + + - name: "Install latest cloud-init version" + include_tasks: ../utils/install_uninstall_package.yml + vars: + package_list: ["cloud-init"] + package_state: "latest" + when: + - guest_os_ansible_distribution == "OracleLinux" + - guest_os_ansible_distribution_ver in ['8.7', '9.1'] + # Check whether cloud-init version meets cloud-init GOSC requirements # Debian 10 and 11 cloud-init GOSC requires cloud-init 22.1 or later installed. # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008039