Hide Forgot
Description of problem: Attempt to use winrm to manage a windows instance and get a stack trace declaring that cannot import xmltodict Version-Release number of selected component (if applicable): ansible-2.1.2.0-1.fc25.noarch How reproducible: always Steps to Reproduce: 1. Point ansible to a windows machine to manage 2. Direct ansible to use winrm as per http://docs.ansible.com/ansible/intro_windows.html 3. ansible -m setup -i hosts windows Actual results: An exception occurred during task execution. The full traceback is: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 124, in run res = self._execute() File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 411, in _execute self._connection = self._get_connection(variables=variables, templar=templar) File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 652, in _get_connection connection = self._shared_loader_obj.connection_loader.get(conn_type, self._play_context, self._new_stdin) File "/usr/lib/python2.7/site-packages/ansible/plugins/__init__.py", line 333, in get self._module_cache[path] = self._load_module_source('.'.join([self.package, name]), path) File "/usr/lib/python2.7/site-packages/ansible/plugins/__init__.py", line 319, in _load_module_source module = imp.load_source(name, path, module_file) File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", line 28, in <module> import xmltodict ImportError: No module named xmltodict w7-ansible-test | FAILED! => { "failed": true, "msg": "Unexpected failure during module execution.", "stdout": "" } Expected results: Facts from the windows instance Additional info: On a sidenote it appears Fedora does not package pywinrm at present... but this particular import happens before the test that then says "you don't have winrm" which is a separate issue
For anyone wanting to do remote management of windows with ansible python-winrm now has a review request here: https://bugzilla.redhat.com/show_bug.cgi?id=1383447 This will go up in a COPR in due course until such time as the review is complete.
Would you be willing to file this particular one upstream? https://github.com/ansible/ansible/issues Or would you prefer I do so?
I'll verify the behaviour upstream and create an appropriate issue there linking it back here later on
Ah the stacktrace issue appears to be fixed upstream already: https://github.com/ansible/ansible/commit/8bbbe16d31d68e097a9748c7563bbea18cfdd87b Note that winrm depends on xmltodict so once the package is approved and imported into Fedora any user who wishes to use it will get that pulled in anyway.