mirror of
https://github.com/ben-grande/qusal.git
synced 2025-08-23 21:06:03 -04:00
refactor: initial commit
This commit is contained in:
commit
f6ac229306
594 changed files with 18600 additions and 0 deletions
46
salt/utils/macros/sync-appmenus.sls
Normal file
46
salt/utils/macros/sync-appmenus.sls
Normal file
|
@ -0,0 +1,46 @@
|
|||
{#
|
||||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#}
|
||||
|
||||
{#
|
||||
Qubes Sync Appmenus
|
||||
|
||||
Usage:
|
||||
1: Import this template:
|
||||
{% from 'utils/macros/sync-appmenus.sls' import sync_appmenus -%}
|
||||
|
||||
2: Set qube to sync the appmenus:
|
||||
{{ sync_appmenus('tpl-' ~ sls_path) }}
|
||||
{{ sync_appmenus('tpl-ssh') }}
|
||||
#}
|
||||
|
||||
{% macro sync_appmenus(qube) -%}
|
||||
|
||||
{% 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 }}
|
||||
|
||||
{% set gui_user = salt['cmd.shell']('groupmems -l -g qubes') -%}
|
||||
"{{ qube }}-sync-appmenus":
|
||||
cmd.run:
|
||||
- require:
|
||||
- qvm: {{ qube }}-start
|
||||
- name: qvm-sync-appmenus {{ qube }}
|
||||
- runas: {{ gui_user }}
|
||||
|
||||
{% if running == 0 -%}
|
||||
"{{ qube }}-shutdown":
|
||||
qvm.shutdown:
|
||||
- require:
|
||||
- cmd: {{ qube }}-sync-appmenus
|
||||
- name: {{ qube }}
|
||||
{% endif -%}
|
||||
|
||||
{% endmacro -%}
|
Loading…
Add table
Add a link
Reference in a new issue