Closed kartnico closed 3 years ago
Thanks for the report, @kartnico. As you can see under the Actions
tab, we have Windows testing taking place, so I wonder why that's not tripping up on this. In fact, it's picking it up as kitchen
:
From a quick look around, it appears that the whoami
command should work.
https://ss64.com/nt/whoami.html
Equivalent bash command (Linux): whoami - Print the current user id and name (
id -un
).
Can you try that out and see if it works for you?
{%- set rootuser = salt['cmd.run']("whoami") %}
works on Windows 10.
Tested whoami
in GitHub Actions but this causes a different value to be set:
Would need to figure out how to ensure the same value is extracted.
Could you try this ?
{%- set rootuser = salt['cmd.powershell']("(whoami).split('\')[1]") %}
It works also for me.
Could you try this ?
{%- set rootuser = salt['cmd.powershell']("(whoami).split('\')[1]") %}
It works also for me.
@kartnico Due to the nature of cmd.powershell
, that ends up returning an empty dict (rootuser: {}
). See the following for more info:
Tried various other combinations but finally found one that works properly:
{%- set rootuser = salt['cmd.run']("whoami").split("\\")[1] %}
That's working on Vagrant (locally) as well as in GitHub Actions:
It also works for me. Thank you.
Closed in error.
Thanks for reopening, @dafyddj -- the fix still needs to be provided here, since it was only tested in my fork.
:tada: This issue has been resolved in version 1.8.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Formula commit hash / release tag
commit a1b488790ee189c37e2a50de33def43356fb282a Author: semantic-release-bot semantic-release-bot@martynus.net Date: Wed Dec 23 18:54:47 2020 +0000
Versions reports (master & minion)
minion :
master :
Pillar / config used
Bug details
Describe the bug