fix: do not remove created dvm

The removal was first implemented to get a clean state of the qube, but
there are side effects, it fails if the user created a named disposable
based on the dvm and also removes the (dvm) entry from the appmenu.

The sys-usb case is a workaround in case the user selected a
non-disposable, an appvm sys-usb during system installation.
This commit is contained in:
Ben Grande 2024-01-10 14:27:44 +01:00
parent 5b9b0bba5b
commit 040594ae74
5 changed files with 6 additions and 21 deletions

View File

@ -14,7 +14,6 @@ include:
"dvm-{{ template.template }}-absent":
qvm.absent:
- names:
- dvm-{{ template.template_clean }}
- {{ template.template_clean }}-dvm
- {{ template.template }}-dvm

View File

@ -14,7 +14,6 @@ include:
"dvm-{{ template.template }}-absent":
qvm.absent:
- names:
- dvm-{{ template.template_clean }}
- {{ template.template_clean }}-dvm
- {{ template.template }}-dvm

View File

@ -14,7 +14,6 @@ include:
"dvm-{{ template.template }}-absent":
qvm.absent:
- names:
- dvm-{{ template.template_clean }}
- {{ template.template_clean }}-dvm
- {{ template.template }}-dvm

View File

@ -14,7 +14,6 @@ include:
"dvm-{{ template.template }}-absent":
qvm.absent:
- names:
- dvm-{{ template.template_clean }}
- {{ template.template_clean }}-dvm
- {{ template.template }}-dvm

View File

@ -10,24 +10,13 @@ SPDX-License-Identifier: AGPL-3.0-or-later
include:
- .clone
{#
"{{ slsdotpath }}-updated-dom0":
pkg.uptodate:
- refresh: True
"{{ slsdotpath }}-install-dom0-package":
pkg.installed:
- pkgs:
- qubes-ctap-dom0
#}
"{{ slsdotpath }}-absent":
## If sys-usb is an AppVM, the state will fail, replace the AppVM for a DispVM
{% set non_disp_usb = salt['cmd.shell']("qvm-ls --no-spinner --raw-data --fields=NAME,CLASS sys-usb sys-usb-dock sys-usb-left 2>/dev/null | awk -F '|' '!/\|DispVM$/{print $1}'") -%} # noqa: 204
{% for wrong_class in non_disp_usb.split("\n") -%}
"{{ slsdotpath }}-absent-{{ wrong_class }}":
qvm.absent:
- names:
- {{ slsdotpath }}
- sys-usb-dock
- sys-usb-left
- dvm-{{ slsdotpath }}
- name: {{ wrong_class }}
{% endfor -%}
{% load_yaml as defaults -%}
name: dvm-{{ slsdotpath }}