Skip to content

Commit

Permalink
Set guest_os_with_gui=false when no display manager
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Zhang <qiz@vmware.com>
  • Loading branch information
keirazhang committed Aug 4, 2023
1 parent 1b825d5 commit 20637ca
Showing 1 changed file with 9 additions and 1 deletion.
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 @@ -32,6 +32,15 @@
ignore_errors: true
delegate_to: "{{ vm_guest_ip }}"

# 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)
- name: "Set fact of guest OS display manager"
ansible.builtin.set_fact:
guest_os_display_manager: |-
Expand All @@ -51,7 +60,6 @@
- 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

0 comments on commit 20637ca

Please sign in to comment.