qusal/salt/dom0/gui-user.jinja
Ben Grande 5722a25779
fix: discover non-root username at runtime
Useful when Dom0 has the non-default username, less useful for DomUs.

Fixes: https://github.com/ben-grande/qusal/issues/43
2024-04-30 16:04:40 +02:00

10 lines
426 B
Django/Jinja

{#
SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% set gui_user = salt['cmd.shell']("getent group qubes | awk -F '[:,]' '{print $4}'") -%}
{% set gui_user_id = salt['cmd.shell']("getent passwd " ~ gui_user ~ " | awk -F ':' '{print $3}'") -%}
{% set gui_user_home = salt['cmd.shell']("getent passwd " ~ gui_user ~ " | awk -F ':' '{print $6}'") -%}