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] Correct ovt_packages for Linux guest OS with desktop #487

Merged
merged 2 commits into from
Aug 7, 2023
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
10 changes: 9 additions & 1 deletion linux/utils/check_guest_os_gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@
- display_manager_status.rc == 0
- display_manager_status.stdout_lines is defined
- display_manager_status.stdout_lines | length > 0

# If systemctl status display-manager.service error code is 4, it means
# the service doesn't exist, so guest OS doesn't have desktop
- name: "Set fact of guest OS having no desktop environment"
ansible.builtin.set_fact:
guest_os_with_gui: false
when: >
(display_manager_status.rc is undefined or
display_manager_status.rc == 4)
when:
- guest_os_with_gui | bool
- guest_os_ansible_distribution != 'Astra Linux (Orel)'


- name: "Set fact of guest OS display manager for {{ guest_os_ansible_distribution }}"
ansible.builtin.set_fact:
guest_os_display_manager: "fly-dm"
Expand Down
44 changes: 22 additions & 22 deletions linux/utils/set_ovt_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
---
# Set the fact of open-vm-tools packages, processes and services
#
- name: "Initialize the fact of open-vm-tools packages, processe and service"
- name: "Set fact of open-vm-tools service for {{ guest_os_ansible_distribution }}"
ansible.builtin.set_fact:
ovt_packages: ["open-vm-tools"]
ovt_processes: [{"uid": "root", "cmd":"vmtoolsd"}]
ovt_service: |-
{%- if guest_os_family == 'FreeBSD' -%}vmware-guestd
{%- elif guest_os_family in ['Debian', 'Astra Linux (Orel)'] -%}open-vm-tools
{%- else -%}vmtoolsd
{%- endif -%}

- name: "Update the fact of ovt_packages for FreeBSD without GUI"
- name: "Set facts of open-vm-tools packages and processes for {{ guest_os_ansible_distribution }}"
ansible.builtin.set_fact:
ovt_packages: ["open-vm-tools-nox11"]
when:
- guest_os_ansible_distribution == "FreeBSD"
- guest_os_with_gui is undefined or not guest_os_with_gui

- name: "Add extra package libvmtools0 for {{ guest_os_ansible_distribution }}"
ansible.builtin.set_fact:
ovt_packages: "{{ ovt_packages | union(['libvmtools0']) }}"
when: guest_os_family == "Suse"

- name: "Update the fact of open-vm-tools packages for {{ guest_os_family }}"
ansible.builtin.set_fact:
ovt_packages: "{{ ovt_packages | union(['open-vm-tools-desktop']) }}"
when: guest_os_family != "FreeBSD"
ovt_packages: |-
{%- if guest_os_family == 'FreeBSD' -%}["open-vm-tools-nox11"]
{%- elif guest_os_family == "Suse" -%}["open-vm-tools", "libvmtools0"]
{%- else -%}["open-vm-tools"]
{%- endif -%}
ovt_processes:
- {"uid": "root", "cmd":"vmtoolsd"}
when: guest_os_with_gui is undefined or not guest_os_with_gui

- name: "Update the fact of open-vm-tools processes with desktop"
- name: "Set facts of open-vm-tools packages and processes for {{ guest_os_ansible_distribution }}"
ansible.builtin.set_fact:
ovt_processes: "{{ ovt_processes | union([{'uid':'vmware', 'cmd':'vmtoolsd -n vmusr'}]) }}"
when: guest_os_with_gui is defined and guest_os_with_gui

ovt_packages: |-
{%- if guest_os_family == 'FreeBSD' -%}["open-vm-tools"]
{%- elif guest_os_family == "Suse" -%}["open-vm-tools", "open-vm-tools-desktop", "libvmtools0"]
{%- else -%}["open-vm-tools", "open-vm-tools-desktop"]
{%- endif -%}
ovt_processes:
- {"uid": "root", "cmd":"vmtoolsd"}
- {'uid':'vmware', 'cmd':'vmtoolsd -n vmusr'}
when:
- guest_os_with_gui is defined
- guest_os_with_gui