WinRM credentials reported invalid, but they just aren't...
hanserasmus opened this issue · comments
Describe the bug
Ansible playbooks with winrm works 100% through rundeck. Configuring the winrm credentials in rundeck results in nodes being discovered through the ansible inventory, and added to rundeck. But, none of the jobs or commands using winrm wants to execute, and results in an error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/winrm/transport.py", line 328, in _send_message_request
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: for url: http://10.65.170.142:5985/wsman
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lib/rundeck/libext/cache/py-winrm-plugin-2.1.3/winrm-check.py", line 256, in <module>
result = session.run_cmd(exec_command)
File "/usr/local/lib/python3.10/dist-packages/winrm/__init__.py", line 40, in run_cmd
shell_id = self.protocol.open_shell()
File "/usr/local/lib/python3.10/dist-packages/winrm/protocol.py", line 166, in open_shell
res = self.send_message(xmltodict.unparse(req))
File "/usr/local/lib/python3.10/dist-packages/winrm/protocol.py", line 243, in send_message
resp = self.transport.send_message(message)
File "/usr/local/lib/python3.10/dist-packages/winrm/transport.py", line 322, in send_message
response = self._send_message_request(prepared_request, message)
File "/usr/local/lib/python3.10/dist-packages/winrm/transport.py", line 332, in _send_message_request
raise InvalidCredentialsError("the specified credentials were rejected by the server")
winrm.exceptions.InvalidCredentialsError: the specified credentials were rejected by the server
Script result code was: 1
Execution failed: 21 in project ced_win_adhoc: [Workflow result: , step failures: {1=NonZeroResultCode: Script result code was: 1}, status: failed]
As I said, the credentials are not invalid, because the same credentials are being used in ansible playbooks, and the same credentials actually logs into the devices to pull the node details (I can see that in the logs).
My Rundeck detail
- Rundeck version: 5.1.0
- install type: deb
- OS Name/version: Ubuntu 22.04]
- DB Type/version: MariaDB
To Reproduce
Steps to reproduce the behavior:
- Add a project with default executor of winrm
- Under project hosts, add your ansible inventory file as source of nodes
- Once all nodes are imported, try and run a simple command, like
ipconfig
on a node, via the rundeck command tab. - Check the log output.
Expected behavior
I expect the connection to be successful and execute the command.
Screenshots
.
Desktop (please complete the following information):
- OS: Ubuntu 22.04
- Browser; Firefox
- Version 110