{%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %} | {%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %} | ||||
{%- set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} | {%- set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} | ||||
{%- elif grains.os_family == 'Windows' %} | {%- elif grains.os_family == 'Windows' %} | ||||
{%- set rootuser = salt['cmd.run']("id -un") %} | |||||
{%- set rootuser = salt['cmd.run']("whoami").split("\\")[1] %} | |||||
{%- endif %} | {%- endif %} | ||||