Hi,
I’m working through trying ansible to manage windows hosts for the first time using CentOS7 as my control machine and Windows 2012r2 as my target.
The system I’m building is disconnected from the internet, so my only real “outside” connection is the mirror I’ve made of the CentOS7 and EPEL repositories I’ve created in my lab. Ansible v2.2.0 has been installed from epel, and it’s been working like a charm until now.
Going through the Ansible Windows Intro, I tried running “ansible hostname -m setup”, and get the “winrm is not installed” message. While the document said to install winrm using pip, since I don’t have internet connectivity, I installed the python2-winrm package from epel, but I still get the same message.
Any ideas on what I can do to make ansible see my winrm installation?
Thanks!
Tom A.
Hi,
You probably need python-requests too
yum install python2-winrm python2-requests_ntlm python-requests
To debug to see what package is needed, you can run python interactively and do import winrm, it will put some messages to help you debug the problem.
Perhaps, you should do a bug report on bugzilla.redhat.com in order to fix this.
Regards,
JYL
2 janvier 2017 04:00 “Tom Albrecht” <tom.albrecht@gmail.com> a écrit:
That was it.
So, to summarize, I removed all three packages, and running python interactively, I of course got the “No module named winrm”. When I added just the “python2-winrm” package, it installed “python2-requests_ntlm” as a dependency, but not “python2-requests”. I got the following:
`
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/site-packages/winrm/init.py”, line 6, in
from winrm.protocol import Protocol
File “/usr/lib/python2.7/site-packages/winrm/protocol.py”, line 11, in
from winrm.transport import Transport
File “/usr/lib/python2.7/site-packages/winrm/transport.py”, line 19, in
import requests
ImportError: No module named requests
`
Once I added the “python-requests” package, the import worked fine, and ansible was happy.
Thanks for the support!
Tom A.
Bug report submitted to epel.
You should correct the bug report to point to el7 instead of el6
regards,
JYL