fix: separate template formula per flavor

Default template flavor is Gnome, installing Xfce when requesting the
template formula without flavor causes confusion.
This commit is contained in:
Ben Grande 2024-01-12 17:47:21 +01:00
parent 233ac76bcb
commit 5502103901
20 changed files with 360 additions and 2 deletions

View File

@ -0,0 +1,34 @@
# debian
Debian Xfce Template in Qubes OS.
## Table of Contents
* [Description](#description)
* [Installation](#installation)
* [Usage](#usage)
## Description
Creates the Debian Xfce Template as well as a Disposable Template based on it.
## Installation
- Top:
```sh
qubesctl top.enable debian-xfce
qubesctl --targets=debian-12-xfce state.apply
qubesctl top.disable debian-xfce
```
- State:
<!-- pkg:begin:post-install -->
```sh
qubesctl state.apply debian-xfce.create
qubesctl --skip-dom0 --targets=debian-12-xfce state.apply debian-xfce.install
```
<!-- pkg:end:post-install -->
## Usage
AppVMs and StandaloneVMs can be based on this template.

View File

@ -0,0 +1,12 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{%- import slsdotpath ~ "/template.jinja" as template -%}
"{{ template.template }}-template-installed":
qvm.template_installed:
- name: {{ template.template }}
- fromrepo: {{ template.repo }}

View File

@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'dom0':
- match: nodegroup
- debian-xfce.clone

View File

@ -0,0 +1,62 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{%- from "qvm/template.jinja" import load -%}
{%- import slsdotpath ~ "/template.jinja" as template -%}
include:
- .clone
"dvm-{{ template.template }}-absent":
qvm.absent:
- names:
- {{ template.template_clean }}-dvm
- {{ template.template }}-dvm
{% load_yaml as defaults -%}
name: dvm-{{ template.template_clean }}
force: True
require:
- sls: {{ slsdotpath }}.clone
present:
- template: {{ template.template }}
- label: red
prefs:
- template: {{ template.template }}
- label: red
- memory: 300
- maxmem: 800
- vcpus: 1
- template_for_dispvms: True
- include_in_backups: False
features:
- enable:
- appmenus-dispvm
- set:
- menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop"
{%- endload %}
{{ load(defaults) }}
{% load_yaml as defaults -%}
name: {{ template.template }}
force: True
require:
- sls: {{ slsdotpath }}.clone
present:
- label: black
prefs:
- label: black
- memory: 300
- maxmem: 600
- vcpus: 1
- include_in_backups: False
features:
- set:
- menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop"
- default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop"
{%- endload %}
{{ load(defaults) }}

View File

@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'dom0':
- match: nodegroup
- debian-xfce.create

13
salt/debian-xfce/init.top Normal file
View File

@ -0,0 +1,13 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'dom0':
- match: nodegroup
- debian-xfce.create
'I@qubes:type:template and E@^debian-[0-9][0-9]-xfce$':
- match: compound
- debian-xfce.install

View File

@ -0,0 +1,13 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% if grains['nodename'] != 'dom0' -%}
"{{ slsdotpath }}-updated":
pkg.uptodate:
- refresh: True
{% endif %}

View File

@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'I@qubes:type:template and E@^debian-[0-9][0-9]-xfce$':
- match: compound
- debian-xfce.install

View File

@ -0,0 +1,15 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% set base = 'debian' -%}
{% set version = salt['pillar.get']('qvm:debian:version', '12') -%}
{% set flavor = 'xfce' -%}
{% set repo = salt['pillar.get']('qvm:debian:repo', 'qubes-templates-itl') -%}
{% if flavor -%}
{% set flavor = '-' ~ flavor -%}
{% endif -%}
{% set template = base ~ '-' ~ version ~ flavor -%}
{% set template_clean = base ~ flavor -%}

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% set base = 'debian' -%}
{% set version = salt['pillar.get']('qvm:debian:version', '12') -%}
{% set flavor = salt['pillar.get']('qvm:debian:flavor', 'xfce') -%}
{% set flavor = '' -%}
{% set repo = salt['pillar.get']('qvm:debian:repo', 'qubes-templates-itl') -%}
{% if flavor -%}
{% set flavor = '-' ~ flavor -%}

View File

@ -0,0 +1,34 @@
# fedora
Fedora Xfce Template in Qubes OS.
## Table of Contents
* [Description](#description)
* [Installation](#installation)
* [Usage](#usage)
## Description
Creates the Fedora Xfce template as well as a Disposable Template based on it.
## Installation
- Top:
```sh
qubesctl top.enable fedora-xfce
qubesctl --targets=fedora-38-xfce state.apply
qubesctl top.disable fedora-xfce
```
- State:
<!-- pkg:begin:post-install -->
```sh
qubesctl state.apply fedora-xfce.create
qubesctl --skip-dom0 --targets=fedora-38-xfce state.apply fedora-xfce.install
```
<!-- pkg:end:post-install -->
## Usage
AppVMs and StandaloneVMs can be based on this template.

View File

@ -0,0 +1,12 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{%- import slsdotpath ~ "/template.jinja" as template -%}
"{{ template.template }}-template-installed":
qvm.template_installed:
- name: {{ template.template }}
- fromrepo: {{ template.repo }}

View File

@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'dom0':
- match: nodegroup
- fedora-xfce.clone

View File

@ -0,0 +1,62 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{%- from "qvm/template.jinja" import load -%}
{%- import slsdotpath ~ "/template.jinja" as template -%}
include:
- .clone
"dvm-{{ template.template }}-absent":
qvm.absent:
- names:
- {{ template.template_clean }}-dvm
- {{ template.template }}-dvm
{% load_yaml as defaults -%}
name: dvm-{{ template.template_clean }}
force: True
require:
- sls: {{ template.template_clean }}.clone
present:
- template: {{ template.template }}
- label: red
prefs:
- template: {{ template.template }}
- label: red
- memory: 300
- maxmem: 400
- vcpus: 1
- template_for_dispvms: True
- include_in_backups: False
features:
- enable:
- appmenus-dispvm
- set:
- menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop"
{%- endload %}
{{ load(defaults) }}
{% load_yaml as defaults -%}
name: {{ template.template }}
force: True
require:
- sls: {{ template.template_clean }}.clone
present:
- label: black
prefs:
- label: black
- memory: 300
- maxmem: 600
- vcpus: 1
- include_in_backups: False
features:
- set:
- menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop"
- default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop"
{%- endload %}
{{ load(defaults) }}

View File

@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'dom0':
- match: nodegroup
- fedora-xfce.create

13
salt/fedora-xfce/init.top Normal file
View File

@ -0,0 +1,13 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'dom0':
- match: nodegroup
- fedora-xfce.create
'I@qubes:type:template and E@^fedora-[0-9][0-9]-xfce$':
- match: compound
- fedora-xfce.install

View File

@ -0,0 +1,13 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% if grains['nodename'] != 'dom0' -%}
"{{ slsdotpath }}-updated":
pkg.uptodate:
- refresh: True
{% endif %}

View File

@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'I@qubes:type:template and E@^fedora-[0-9][0-9]-xfce$':
- match: compound
- fedora-xfce.install

View File

@ -0,0 +1,15 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% set base = 'fedora' -%}
{% set version = salt['pillar.get']('qvm:fedora:version', '38') -%}
{% set flavor = 'xfce' -%}
{% set repo = salt['pillar.get']('qvm:fedora:repo', 'qubes-templates-itl') -%}
{% if flavor -%}
{% set flavor = '-' ~ flavor -%}
{% endif -%}
{% set template = base ~ '-' ~ version ~ flavor -%}
{% set template_clean = base ~ flavor -%}

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% set base = 'fedora' -%}
{% set version = salt['pillar.get']('qvm:fedora:version', '38') -%}
{% set flavor = salt['pillar.get']('qvm:fedora:flavor', 'xfce') -%}
{% set flavor = '' -%}
{% set repo = salt['pillar.get']('qvm:fedora:repo', 'qubes-templates-itl') -%}
{% if flavor -%}
{% set flavor = '-' ~ flavor -%}