Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Add config option 'without-x' for installing open-vm-tools from source on Ubuntu 24.04 #621

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions linux/open_vm_tools/install_ovt_from_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
ovt_check_config_file_tmpl: "{{ guest_os_ansible_system }}_ovt_check_config.tmpl"
ovt_check_config_file_path: "{{ current_test_log_folder }}/ovt_check_config.yml"

- name: "Create config files for installing open-vm-tools from source"
- name: "Create build config file for installing open-vm-tools from source"
ansible.builtin.template:
src: "templates/{{ item[0] }}"
dest: "{{ item[1] }}"
src: "templates/{{ ovt_build_config_file_tmpl }}"
dest: "{{ ovt_build_config_file_path }}"
mode: "0755"
with_list:
- ["{{ ovt_build_config_file_tmpl }}", "{{ ovt_build_config_file_path }}"]
- ["{{ ovt_check_config_file_tmpl }}", "{{ ovt_check_config_file_path }}"]

- name: "Set facts of dependencies and configure options to install open-vm-tools from source"
ansible.builtin.set_fact:
Expand Down Expand Up @@ -122,6 +119,12 @@
retries: 60
delay: 10

- name: "Create check config file after installing open-vm-tools from source"
ansible.builtin.template:
src: "templates/{{ ovt_check_config_file_tmpl }}"
dest: "{{ ovt_check_config_file_path }}"
mode: "0755"

- name: "Set facts of open-vm-tools files and plugins should be installed from source"
ansible.builtin.set_fact:
ovt_files: "{{ _ovt_check_config | dict2items | map(attribute='value') | flatten | sort }}"
Expand Down
5 changes: 4 additions & 1 deletion linux/open_vm_tools/templates/linux_ovt_build_config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@ dependencies:
- xmlsec1-openssl-devel
- xorg-x11-devel
{% endif %}
configure_options: []
{% if guest_os_ansible_distribution == 'Ubuntu' and guest_os_ansible_distribution_ver == '24.04' %}
configure_options:
- "--without-x"
{% endif %}
8 changes: 6 additions & 2 deletions linux/open_vm_tools/templates/linux_ovt_check_config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ binaries:
- "{{ ovt_install_prefix }}/bin/vmware-rpctool"
- "{{ ovt_install_prefix }}/bin/vmware-toolbox-cmd"
- "{{ ovt_install_prefix }}/bin/vmware-xferlogs"
- "{{ ovt_install_prefix }}/bin/vmware-user-suid-wrapper"
- "{{ ovt_install_prefix }}/bin/VGAuthService"
- "{{ ovt_install_prefix }}/bin/vmware-vgauth-smoketest"
- "{{ ovt_install_prefix }}/bin/vmware-vgauth-cmd"
- "{{ ovt_install_prefix }}/bin/vmware-alias-import"
{% if (ovt_configure_options | select('match', '--without-x') | length) == 0 %}
- "{{ ovt_install_prefix }}/bin/vmware-user-suid-wrapper"
{% endif %}
scripts:
- "/etc/vmware-tools/poweroff-vm-default"
- "/etc/vmware-tools/poweron-vm-default"
Expand Down Expand Up @@ -79,12 +81,14 @@ plugins:
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libgdp.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libpowerOps.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libvmbackup.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libresolutionKMS.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libguestStore.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libguestInfo.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libcomponentMgr.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libdeployPkgPlugin.so"
{% if (ovt_configure_options | select('match', '--without-x') | length) == 0 %}
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmsvc/libresolutionKMS.so"
vmusr_plugins:
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmusr/libdesktopEvents.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmusr/libdndcp.so"
- "{{ ovt_install_prefix }}/lib/open-vm-tools/plugins/vmusr/libresolutionSet.so"
{% endif %}
37 changes: 23 additions & 14 deletions linux/utils/get_cloudinit_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,32 @@
#
- name: "Initialize the fact of cloud-init version"
ansible.builtin.set_fact:
cloudinit_bin_path: "/usr/bin/cloud-init"
cloudinit_version: ""

# Some OS might print cloud-init version to stderr
- name: "Get cloud-init version from package info"
ansible.builtin.shell: "/usr/bin/cloud-init --version 2>&1 | awk '{print $2}'"
delegate_to: "{{ vm_guest_ip }}"
ignore_errors: true
register: get_cloudinit_version
- name: "Check {{ cloudinit_bin_path }} exists"
include_tasks: get_file_stat_info.yml
vars:
guest_file_path: "{{ cloudinit_bin_path }}"

- name: "Set fact of cloud-init version"
ansible.builtin.set_fact:
cloudinit_version: "{{ get_cloudinit_version.stdout }}"
when:
- get_cloudinit_version.rc is defined
- get_cloudinit_version.rc == 0
- get_cloudinit_version.stdout is defined
- get_cloudinit_version.stdout
- name: "Get cloud-init version"
when: guest_file_exists
block:
# Some OS might print cloud-init version to stderr
- name: "Get cloud-init version from package info"
ansible.builtin.shell: "{{ cloudinit_bin_path }} --version 2>&1"
delegate_to: "{{ vm_guest_ip }}"
ignore_errors: true
register: get_cloudinit_version

- name: "Set fact of cloud-init version"
ansible.builtin.set_fact:
cloudinit_version: "{{ get_cloudinit_version.stdout | replace(cloudinit_bin_path, '') | trim }}"
when:
- get_cloudinit_version.rc is defined
- get_cloudinit_version.rc == 0
- get_cloudinit_version.stdout is defined
- get_cloudinit_version.stdout

- name: "Print the cloud-init version"
ansible.builtin.debug: var=cloudinit_version
10 changes: 5 additions & 5 deletions linux/utils/get_os_edition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
guest_os_edition: ""

- name: "Get Ubuntu edition"
when: guest_os_ansible_distribution == "Ubuntu"
block:
- name: "Get installed packages on {{ guest_os_ansible_distribution }}"
include_tasks: get_installed_packages.yml
Expand All @@ -19,13 +20,13 @@
ansible.builtin.set_fact:
guest_os_edition: |-
{%- if 'linux-image-virtual' in guest_installed_packages -%}CloudImage
{%- elif 'ubuntu-server' in guest_installed_packages -%}Server
{%- elif 'ubuntu-desktop' in guest_installed_packages -%}Desktop
{%- else -%}{%- endif -%}
{%- elif guest_installed_packages | select('search', 'ubuntu-server') | length > 0 -%}Server
{%- elif guest_installed_packages | select('search', 'ubuntu-desktop') | length > 0 -%}Desktop
{%- endif -%}
when: guest_installed_packages | length > 0
when: guest_os_ansible_distribution == "Ubuntu"

- name: "Get Pardus edition"
when: guest_os_ansible_distribution is match("Pardus.*")
block:
- name: "Get display manager on {{ guest_os_ansible_distribution }}"
include_tasks: check_guest_os_gui.yml
Expand All @@ -38,7 +39,6 @@
{%- elif guest_os_display_manager == 'gdm' -%}GNOME
{%- else -%}Server
{%- endif -%}
when: guest_os_ansible_distribution is match("Pardus.*")

- name: "Get Fedora Edition"
ansible.builtin.set_fact:
Expand Down