From f903c0e3df00914b3278ed932271e1941c1ecb98 Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Fri, 28 Jun 2024 19:28:49 +0200 Subject: [PATCH] feat: get GUI user with salt modules --- salt/dom0/gui-user.jinja | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/salt/dom0/gui-user.jinja b/salt/dom0/gui-user.jinja index e7232299..a423ff30 100644 --- a/salt/dom0/gui-user.jinja +++ b/salt/dom0/gui-user.jinja @@ -4,6 +4,6 @@ SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. 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}'") -%} +{% set gui_user = salt["group.info"]("qubes").get("members")[0] -%} +{% set gui_user_id = salt["user.info"](gui_user).get("uid") -%} +{% set gui_user_home = salt["user.info"](gui_user).get("home") -%}