Use WinRM Node Executor Python and Ansible inventory as resources in Rundeck

0

I was setting up a rundeck instance (Version 3.0.7-CE) and tried to use WinRM Node Executor Python and Ansible inventory plugin together.

Below is my project setting details:

enter image description here

If I used File as Node Sources, I was able to run commands and execute script normally.

However, If I used Ansible Resource Model Source, and when I run a simple command like just "hostname", I was getting error below:

Exception in thread Thread-1:
16:20:41            Traceback (most recent call last):
16:20:41              File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
16:20:41                self.run()
16:20:41              File "/usr/lib64/python2.7/threading.py", line 765, in run
16:20:41                self.__target(*self.__args, **self.__kwargs)
16:20:41              File "/var/lib/rundeck/libext/cache/py-winrm-plugin-1.0.7/winrm_session.py", line 143, in get_response
16:20:41                response = self.session.run_ps(self.exec_command, out_stream=self.o_stream, err_stream=self.e_stream)
16:20:41              File "/var/lib/rundeck/libext/cache/py-winrm-plugin-1.0.7/winrm_session.py", line 63, in run_ps
16:20:41                rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps),out_stream=out_stream, err_stream=err_stream)
16:20:41              File "/var/lib/rundeck/libext/cache/py-winrm-plugin-1.0.7/winrm_session.py", line 46, in run_cmd
16:20:41                shell_id = self.protocol.open_shell()
16:20:41              File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 157, in open_shell
16:20:41                res = self.send_message(xmltodict.unparse(req))
16:20:41              File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 234, in send_message
16:20:41                resp = self.transport.send_message(message)
16:20:41              File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 256, in send_message
16:20:41                response = self._send_message_request(prepared_request, message)
16:20:41              File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 261, in _send_message_request
16:20:41                response = self.session.send(prepared_request, timeout=self.read_timeout_sec)
16:20:41              File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 644, in send
16:20:41                r = dispatch_hook('response', hooks, r, **kwargs)
16:20:41              File "/usr/lib/python2.7/site-packages/requests/hooks.py", line 31, in dispatch_hook
16:20:41                _hook_data = hook(hook_data, **kwargs)
16:20:41              File "/usr/lib/python2.7/site-packages/requests_credssp/credssp.py", line 448, in response_hook
16:20:41                response = self.handle_401(response, **kwargs)
16:20:41              File "/usr/lib/python2.7/site-packages/requests_credssp/credssp.py", line 487, in handle_401
16:20:41                out_token, step_name = credssp_gen.send(in_token)
16:20:41              File "/usr/lib/python2.7/site-packages/requests_credssp/credssp.py", line 158, in credssp_generator
16:20:41                ts_request.check_error_code()
16:20:41              File "/usr/lib/python2.7/site-packages/requests_credssp/asn_structures.py", line 125, in check_error_code
16:20:41                raise NTStatusException(status)
16:20:41            NTStatusException: Received error status from the server: (3221225581) STATUS_LOGON_FAILURE 0xc000006d

It will be great if someone can shed some lights.

Thank you all in advanced.

python
rundeck
asked on Stack Overflow Oct 25, 2018 by weijie lin

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0