qusal/salt/utils/macros/switch-template.sls
Ben Grande aea8438904
fix: stricter command-line parsing
- Add to qvm-run:
  - no-gui when command doesn't require a GUI
  - filter-escape-chars when pass-io is set and output is not a file,
    such as a pipe that could later be used to print information.
- Change remaining echo to printf
- Add end-of-options separator when possible
2025-01-08 16:12:31 +01:00

27 lines
689 B
Plaintext

{#
SPDX-FileCopyrightText: 2023 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{#
Switch Template to Default Template
Usage:
1: Import this template:
{% from 'utils/macros/switch-template.sls' import switch_template -%}
2: Set list of qubes to set default template:
{{ switch_template([sls_path, 'example']) }}
#}
{% set default_template = salt['cmd.shell']('qubes-prefs -- default_template') -%}
{% macro switch_template(qubes) -%}
{% for qube in qubes -%}
"{{ slsdotpath }}-reset-{{ qube }}-template-to-default_template":
cmd.run:
- name: qvm-prefs {{ qube }} template {{ default_template }}
{% endfor -%}
{% endmacro -%}