Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"msg": "winrm or requests is not installed: No module named xmltodict"

Tags:

ansible

I have ansible version 2.4.2. Trying to integrate Ansible contorl machine (Linux) with Windows. Checked and installed all pre-requesties.

Getting below error while connecting to windows machine

(ansible) -bash-4.2$ ansible *<windowsservername>* -i inventory -m win_ping
*windowsservername* | FAILED! => {
    "msg": "winrm or requests is not installed: No module named xmltodict"
}

PFB the packages

(ansible) -bash-4.2$ pip freeze | grep -i xmltodict
xmltodict==0.11.0

(ansible) -bash-4.2$ pip freeze | grep -i winrm
pywinrm==0.3.0

I am new to ansible, please help on this issue.

like image 811
Anusha M Avatar asked Aug 01 '18 12:08

Anusha M


People also ask

Why is it necessary to install Pywinrm?

It allows you to invoke commands on target Windows machines from any machine that can run Python. WinRM allows you to perform various management tasks remotely. These include, but are not limited to: running batch scripts, powershell scripts, and fetching WMI variables.


1 Answers

It worked for me . I reinstalled winrm on the controller machine using : pip install --ignore-installed pywinrm

like image 113
vishwas gautam Avatar answered Oct 05 '22 11:10

vishwas gautam