From 3dca6235194af09ece092fe15cc7438bddac6e5a Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Sun, 10 Mar 2024 17:22:39 +0100 Subject: [PATCH] fix: change mgmt template to fedora A Minimal Fedora template can't be the management qube or the targeted qube of Salt as it is missing dependencies that are only available in the full template. The management qube is temporarily changed to the non-minimal version so the minimal template can be targeted once and then it takes over the management disposable template. Fixes: https://github.com/ben-grande/qusal/issues/28 --- salt/mgmt/README.md | 2 +- salt/mgmt/clone.sls | 4 ++-- salt/mgmt/create.sls | 15 +++++++++++++++ salt/mgmt/install.top | 1 + salt/mgmt/prefs.sls | 6 ++++++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/salt/mgmt/README.md b/salt/mgmt/README.md index 81bbad9..2c60b86 100644 --- a/salt/mgmt/README.md +++ b/salt/mgmt/README.md @@ -1,6 +1,6 @@ # mgmt -Management console environment in Qubes OS. +Management environment in Qubes OS. ## Table of Contents diff --git a/salt/mgmt/clone.sls b/salt/mgmt/clone.sls index 0554d7f..8805ae5 100644 --- a/salt/mgmt/clone.sls +++ b/salt/mgmt/clone.sls @@ -1,8 +1,8 @@ {# -SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. SPDX-License-Identifier: AGPL-3.0-or-later #} {% from 'utils/macros/clone-template.sls' import clone_template -%} -{{ clone_template('debian-minimal', sls_path) }} +{{ clone_template('fedora-minimal', sls_path) }} diff --git a/salt/mgmt/create.sls b/salt/mgmt/create.sls index cba3457..eb03850 100644 --- a/salt/mgmt/create.sls +++ b/salt/mgmt/create.sls @@ -7,6 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later {%- from "qvm/template.jinja" import load -%} include: + - fedora.create - .clone {% load_yaml as defaults -%} @@ -45,3 +46,17 @@ features: - internal {%- endload %} {{ load(defaults) }} + +"{{ slsdotpath }}-set-management_dispvm-to-dvm-fedora": + cmd.run: + - require: + - qvm: dvm-fedora + - name: qubes-prefs management_dispvm dvm-fedora + +## TODO: Remove when template with patch reaches upstream. +## https://github.com/QubesOS/qubes-issues/issues/8806 +"{{ slsdotpath }}-install-": + cmd.run: + - require: + - qvm: tpl-{{ slsdotpath }} + - name: qvm-run -u root tpl-{{ slsdotpath }} -- dnf install --refresh --assumeyes --setopt=install_weak_deps=False python3-urllib3 diff --git a/salt/mgmt/install.top b/salt/mgmt/install.top index 5ed61c2..200e748 100644 --- a/salt/mgmt/install.top +++ b/salt/mgmt/install.top @@ -6,4 +6,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later base: 'tpl-mgmt': + - match: glob - mgmt.install diff --git a/salt/mgmt/prefs.sls b/salt/mgmt/prefs.sls index 66bcf22..7ab7ae3 100644 --- a/salt/mgmt/prefs.sls +++ b/salt/mgmt/prefs.sls @@ -13,3 +13,9 @@ SPDX-License-Identifier: AGPL-3.0-or-later - name: default-mgmt-dvm - require: - cmd: {{ slsdotpath }}-set-management_dispvm + +## TODO: Remove when template with patch reaches upstream. +## https://github.com/QubesOS/qubes-issues/issues/8806 +"{{ slsdotpath }}-shutdown-template": + qvm.shutdown: + - name: tpl-{{ slsdotpath }}