-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ansible.windows.win_reboot: failed to get host boot time info #326
Comments
@jborean93 i managed to move to the latest version of ansible and the windows collection, hope you can have a look. |
Thanks for testing this out, it is a very curious error as the command being run produced the expected output in the Can you try out the following task? - raw: |
(Get-CimInstance -ClassName Win32_OperatingSystem -Property LastBootUpTime).LastBootUpTime.ToFileTime() If that also returns an |
@Frantz444 were you able to test out the above, I'm in the neighborhood of |
Hello, Finally managed to get more information regarding this error using the old way - procexp. After "grep-ing" all the relevant processes found the culprit. It was related to some local miss-configuration of CMD which was altered by another program (some tool Clink). It was removed but apparently kept registry entry to it, wasn't related to %PATH% or other env_variables Executing WINRM commands directly from CMD went ok, but when running them through POWERSHELL I got that "The system cannot find the path specified". Because the ansible module executes the WINRM calls using POWERSHELL it ended getting this error. But only for the win_reboot module the task failed, for other ones(not only ansible.windows) it worked. So in the end fixed this entries and got my system cleaned. The module works without any problem. The though part was to identify the issue because it involves multiple tools in this chain of a system reboot. |
Thanks for confirming the problem was due to a misconfiguration on the host. There are a lot of complex processes that this particular plugin tries to invoke compared to normal modules which is likely why you only encountered it here. I'm not sure what else the code could do to help this, unless there was anything in particular you wanted to discuss further I'll close the issue. |
@Frantz444 What exact entries were cleaned by you to fix the issue? I am having the exact same issue where rebooting win 2019 server causing error "ansible.windows.win_reboot: failed to get host boot time info" |
My entries were related to some tool Clink. It had entries in the path and other env variables. Try looking into all of these and check if you spot some unwanted tools that might alter your windows pwsh execution |
SUMMARY
This is related to #324
I'm getting the same behavior using latest ansible version
ISSUE TYPE
COMPONENT NAME
win_reboot
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
EC2 Window Server2019 1809
Connection config:
ansible_connection=winrm
ansible_winrm_transport=kerberos
ansible_winrm_server_cert_validation=ignore
ansible_winrm_kerberos_delegation=true
STEPS TO REPRODUCE
The playbook runs on an Ubuntu 20.04.3 LTS
EXPECTED RESULTS
Reboot
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: