Ansible troubleshooting — Module Failure on Windows-target

How to reproduce, troubleshoot, and fix the Module Failure Ansible fatal error on Windows-target. Demo code included for download file example.

Ansible Pilot
4 min readFeb 8, 2022


Today we’re going to talk about Ansible troubleshooting, specifically about the Module Failure on Windows-target.
I’m Luca Berton and welcome to today’s episode of Ansible Pilot.


How to troubleshoot the Module Failure on Windows-target.

error code

- name: win_get_url module demo
hosts: all
become: false
myurl: ""
mydest: 'C:\Users\vagrant\Desktop\ansible-2.9.25.tar.gz'
- name: download file
url: "{{ myurl }}"
dest: "{{ mydest }}"

error execution

ansible-pilot $ ansible-playbook -i virtualmachines/win/inventory troubleshooting/get_url_error.ymlPLAY [win_get_url module demo] ********************************************************************TASK [Gathering Facts] ****************************************************************************
ok: [WindowsServer]
TASK [download file] ******************************************************************************
[WARNING]: No python interpreters found for host WindowsServer (tried ['python3.10', 'python3.9',
'python3.8', 'python3.7', 'python3.6', 'python3.5', '/usr/bin/python3', '/usr/libexec/platform-
python', 'python2.7', 'python2.6', '/usr/bin/python', 'python'])
fatal: [WindowsServer]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "module_stderr": "Exception calling \"Create\" with \"1\" argument(s): \"At line:4 char:21\r\n+ def _ansiballz_main():\r\n+ ~\r\nAn expression was expected after '('.\r\nAt line:8 char:19\r\n+ os.getcwd()\r\n+ ~\r\nAn expression was expected after '('.\r\nAt line:20 char:27\r\n+ except (AttributeError…



Ansible Pilot

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday