2023-11-13 09:33:28 -05:00
|
|
|
{#
|
2024-01-29 10:49:54 -05:00
|
|
|
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
2023-11-13 09:33:28 -05:00
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
#}
|
|
|
|
|
2024-01-05 12:07:18 -05:00
|
|
|
{% set qube = 'sys-pihole' -%}
|
|
|
|
{% set running = 0 -%}
|
|
|
|
{% if salt['cmd.shell']('qvm-ls --no-spinner --raw-list --running ' ~ qube) == qube -%}
|
|
|
|
{% set running = 1 -%}
|
|
|
|
{% endif -%}
|
|
|
|
|
|
|
|
"{{ slsdotpath }}-start":
|
|
|
|
qvm.start:
|
|
|
|
- name: {{ slsdotpath }}
|
|
|
|
|
2023-11-13 09:33:28 -05:00
|
|
|
"{{ slsdotpath }}-change-prefs":
|
|
|
|
cmd.script:
|
|
|
|
- name: prefs.sh
|
|
|
|
- source: salt://{{ slsdotpath }}/files/admin/prefs.sh
|
|
|
|
|
2024-01-05 12:07:18 -05:00
|
|
|
"{{ slsdotpath }}-qubes-prefs-clockvm":
|
|
|
|
cmd.run:
|
|
|
|
- require:
|
|
|
|
- qvm: "{{ slsdotpath }}-start"
|
|
|
|
- name: qubes-prefs clockvm {{ slsdotpath }}
|
2023-11-13 09:33:28 -05:00
|
|
|
|
|
|
|
"{{ slsdotpath }}-qubes-prefs-updatevm":
|
|
|
|
cmd.run:
|
|
|
|
- require:
|
|
|
|
- qvm: "{{ slsdotpath }}-start"
|
|
|
|
- name: qubes-prefs updatevm {{ slsdotpath }}
|
|
|
|
|
|
|
|
"{{ slsdotpath }}-qubes-prefs-default_netvm":
|
|
|
|
cmd.run:
|
|
|
|
- require:
|
|
|
|
- qvm: "{{ slsdotpath }}-start"
|
|
|
|
- name: qubes-prefs default_netvm {{ slsdotpath }}
|
2024-01-05 12:07:18 -05:00
|
|
|
|
|
|
|
{% if running == 0 -%}
|
|
|
|
"{{ slsdotpath }}-shutdown":
|
|
|
|
qvm.shutdown:
|
|
|
|
- name: {{ default_netvm }}
|
|
|
|
- flags:
|
|
|
|
- wait
|
|
|
|
- force
|
|
|
|
{% endif -%}
|