From 69d598138e18134a9dcf8ed84daf04e3d4e2158e Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 29 Dec 2020 13:15:34 +0000 Subject: [PATCH] fix(osfamilymap): use `whoami` for Windows `rootuser` Fix #495 --- salt/osfamilymap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/osfamilymap.yaml b/salt/osfamilymap.yaml index 7f31b24..327470c 100644 --- a/salt/osfamilymap.yaml +++ b/salt/osfamilymap.yaml @@ -20,7 +20,7 @@ {%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %} {%- set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} {%- elif grains.os_family == 'Windows' %} -{%- set rootuser = salt['cmd.run']("id -un") %} +{%- set rootuser = salt['cmd.run']("whoami").split("\\")[1] %} {%- endif %}