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” committed Mar 30, 2023
1 parent ba03258 commit 75f0a22
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions linux/guest_customization/linux_gosc_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,6 @@
- vmtools_version is version('11.3.5', '>=')
when: guest_os_ansible_distribution == "VMware Photon OS"

# Need to do "yum update" to install the latest cloud-init to Oracle Linux 8.7, 9.1 and pass the GOSC tests in Ansible
# Please refer to https://bugzilla.eng.vmware.com/show_bug.cgi?id=3068525
# Summary: [3rd Oracle Bug 18115][OL 8.7&9.1] Hit AttributeError when starting cloud-init-local.service which led to cloud-init GOSC failures
- name: "Install latest 'cloud-init' for cloud-init GOSC on {{ guest_os_ansible_distribution }}"
block:
- name: "Set cloud-init conf directory"
ansible.builtin.set_fact:
cloudinit_conf_dir: "/etc/cloud"
when: cloudinit_conf_dir is undefined or not cloudinit_conf_dir

- name: "Prepare conf directory {{ cloudinit_conf_dir }} for new confs"
ansible.builtin.shell: |
if [ -e {{ cloudinit_conf_dir }} ] ; then
rm -rf {{ cloudinit_conf_dir }};
fi
mkdir -p {{ cloudinit_conf_dir }}
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']

# Install perl if guest OS doesn't have it
- name: "Prepare for perl GOSC testing on {{ guest_os_ansible_distribution }}"
block:
Expand Down Expand Up @@ -109,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
Expand Down

0 comments on commit 75f0a22

Please sign in to comment.