Skip to content

Commit

Permalink
Fix cloud-init GOSC test issues in Oracle Linux 8.7 and 9.1
Browse files Browse the repository at this point in the history
Signed-off-by: yanhuih2022 <yanhuih@vmware.com>
  • Loading branch information
yanhuih2022 authored and “yanhuih2022” committed Apr 7, 2023
1 parent 5f0605e commit 1a28b3f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
16 changes: 16 additions & 0 deletions linux/guest_customization/linux_gosc_verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@
- gosc_failed_items | length > 0
- vcenter_version is version('6.5.0', '==')

- name: "cloud-init GOSC in OracleLinux 8.7 & 9.1 with original UEK will fail due to known issue"
block:
- name: "Known issue - ignore failure of cloud-init GOSC in Oracle Linux 8.7 and 9.1"
ansible.builtin.debug:
msg:
- "There is a cloud-init issue on Oracle Linux 8.7 and 9.1 when uninstall cloud-init."
- "Files and directories under /etc/cloud/ are not removed after uninstall cloud-init."
- "The issue has been resolved in newer UEK R7 5.15.0-8.91.4.1 release. Please install the latest cloud-init 22.1-6 for resolution."
- "Please refer to https://bugzilla.oracle.com/bugzilla/show_bug.cgi?id=18115"
tags:
- known_issue
when:
- guest_os_ansible_distribution == "OracleLinux"
- guest_os_ansible_distribution_ver in ['8.7', '9.1']
- guest_os_ansible_kernel in ['5.15.0-3.60.5.1.el9uek.x86_64', '5.15.0-3.60.5.1.el8uek.x86_64']

- name: "GOS customization failed"
ansible.builtin.fail:
msg: "{{ gosc_validation_errors | dict2items | selectattr('key', 'in', gosc_failed_items) | map(attribute='value') | flatten }}"
Expand Down
25 changes: 25 additions & 0 deletions linux/guest_customization/linux_gosc_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "Remove /etc/cloud dir before install the latest cloud-init"
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
Expand Down

0 comments on commit 1a28b3f

Please sign in to comment.