qusal/salt/sys-firewall/prefs.sls
Ben Grande 0216297ee6 feat: default to disposable netvm
- Default sys-net and sys-firewall to disposable;
- Set global and per vm preferences by starting the qubes or shutting
  down them when necessary; and
- Less manual steps remaining for the user: just rename the net qube, as
  it can only be done via Qubes Manager.
2024-01-04 21:59:15 +01:00

44 lines
918 B
Plaintext

{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% set qube = slsdotpath -%}
{% set running = 0 -%}
{% if salt['cmd.shell']('qvm-ls --no-spinner --raw-list --running ' ~ qube) == qube -%}
{% set running = 1 -%}
{% endif -%}
"{{ qube }}-start":
qvm.start:
- name: {{ qube }}
"{{ qube }}-qubes-prefs-updatevm":
cmd.run:
- require:
- qvm: {{ qube }}-start
- name: qubes-prefs updatevm {{ qube }}
"{{ qube }}-qubes-prefs-default_netvm":
cmd.run:
- require:
- qvm: {{ qube }}-start
- name: qubes-prefs default_netvm {{ qube }}
"{{ qube }}-qubes-prefs-clockvm":
cmd.run:
- require:
- qvm: {{ qube }}-start
- name: qubes-prefs clockvm {{ qube }}
{% if running == 0 -%}
"{{ qube }}-shutdown":
qvm.shutdown:
- name: {{ qube }}
- flags:
- wait
- force
{% endif -%}