# current devel branch does not work on windows

**URL:** <https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [September 10, 2015, 8:15pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233 "2015-09-10T20:15:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [September 10, 2015, 8:15pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/1 "2015-09-10T20:15:44Z")

</div>

The last working commit I can find which works on windows is ca e2e9319f06b058098cdf4272689766abb95b80f2 ([https://github.com/ansible/ansible/commit/e2e9319f06b058098cdf4272689766abb95b80f2](https://github.com/ansible/ansible/commit/e2e9319f06b058098cdf4272689766abb95b80f2)) note that I haven’t tried all of them. From the logs it looks like ansible is trying to run python code on windows:

elk.admigration.local | FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“msg”: “#\< CLIXML\r\n\<Objs Version="1.1.0.1" xmlns="[http://schemas.microsoft.com/powershell/2004/04\](http://schemas.microsoft.com/powershell/2004/04%5C)”\>\<Obj S="progress" RefId="0"\>\<TN RefId="0"\>System.Management.Automation.PSCustomObjectSystem.Object\<I64 N="SourceId"\>1\<PR N="Record"\>Preparing modules for first use.0-1-1Completed-1 \<Obj S="progress" RefId="1"\>\<TNRef RefId="0" /\>\<I64 N="SourceId"\>1\<PR N="Record"\>Preparing modules for first use.0-1-1Completed-1 \<S S="Error"\>/usr/bin/python : The term ‘/usr/bin/python’ is not recognized as the name of _x000D\_\_x000A_\<S S="Error"\>a cmdlet, function, script file, or operable program. Check the spelling of _x000D\_\_x000A_\<S S="Error"\>the name, or if a path was included, verify that the path is correct and try _x000D\_\_x000A_\<S S="Error"\>again._x000D\_\_x000A_\<S S="Error"\>At line:1 char:7\_x000D\_\_x000A\_\<S S="Error"\>+ Try { /usr/bin/python "C:\Users\ansible\AppData\Local\Temp\ansible-tm …_x000D\_\_x000A_\<S S="Error"\>+ ~~~~~~~~~~~~~~~ _x000D\_\_x000A_\<S S="Error"\> + CategoryInfo : ObjectNotFound: (/usr/bin/python:String) , Par _x000D\_\_x000A_\<S S="Error"\> entContainsErrorRecordException\_x000D\_\_x000A\_\<S S="Error"\> + FullyQualifiedErrorId : CommandNotFoundException\_x000D\_\_x000A\_\<S S="Error"\> _x000D\_\_x000A_",  
“parsed”: false

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [September 11, 2015, 2:01am UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/2 "2015-09-11T02:01:59Z")

</div>

We're aware. It seems  
[https://github.com/ansible/ansible/commit/4b895f04e398deb9c156d4e8b6435073fc2e6f18](https://github.com/ansible/ansible/commit/4b895f04e398deb9c156d4e8b6435073fc2e6f18)  
broke the lookup for PowerShell modules.

---

<div class="post-metadata">

**Author:** ![Balaji\_Chandrababu](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Balaji\_Chandrababu](https://forum.ansible.com/u/Balaji_Chandrababu)\
**Post date:** [February 2, 2016, 2:11pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/3 "2016-02-02T14:11:57Z")

</div>

Hi Chris,

Can you tell me whether this issue is fixed in ansible version: 2.0.0.2 as I’m having an issue while running ansible playbook on aws windows instances.

My playbook looks like this:

- name: ensure security group is present  
ec2\_group:  
name: WinRM RDP  
description: Inbound WinRM and RDP  
region: “{{ target\_aws\_region }}”  
rules:

- proto: tcp  
from\_port: 80  
to\_port: 80  
cidr\_ip: 0.0.0.0/0

- proto: tcp  
from\_port: 5986  
to\_port: 5986  
cidr\_ip: 0.0.0.0/0

- proto: tcp  
from\_port: 3389  
to\_port: 3389  
cidr\_ip: 0.0.0.0/0  
rules\_egress:

- proto: -1  
cidr\_ip: 0.0.0.0/0  
register: sg\_out

- ec2\_ami\_find:  
region: “{{ target\_aws\_region }}”  
platform: windows  
virtualization\_type: hvm  
owner: amazon  
name: Windows\_Server-2012-R2\_RTM-English-64Bit-Base-\*  
no\_result\_action: fail  
sort: name  
sort\_order: descending  
register: found\_amis

None of these modules: ec2\_group, ec2\_ami\_find work for me as it throws this error:

An exception occurred during task execution. The full traceback is:  
At line:4 char:1

- /usr/bin/python "C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-145442138 …
- 

```auto

```

fatal: [aws-win-host]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_name”: “ec2\_group”}, “msg”: “The term ‘/usr/bin/python’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”}

Please tell me if I’m doing something wrong.

Thanks,  
Balaji

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 2, 2016, 2:36pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/4 "2016-02-02T14:36:07Z")

</div>

I have 2.0.0.2 working fine with local windows machines.

Are you running from source? If so perhaps you need to update your submodules

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Balaji\_Chandrababu](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Balaji\_Chandrababu](https://forum.ansible.com/u/Balaji_Chandrababu)\
**Post date:** [February 2, 2016, 3:57pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/5 "2016-02-02T15:57:13Z")

</div>

Hi jhawkesworth,

Yes I’m running from source.

I have cloned the git repository with option set to --recursive and also i have updated the submodules using git submodule update --init --recursive.

Still it’s not working.

While checking the logs, i found that it was using /usr/bin/python in place of C:/Python27/python.

Try  
{  
C:/Python27/python “C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1454428251.01-120917033280940\ec2\_ami\_find.ps1”  
}  
Catch

So i added this in aws\_hosts file:

aws-win-host ansible\_ssh\_host=52.18.216.106 ansible\_python\_interpreter=“C:/Python27/python”

But now i get this error:

An exception occurred during task execution. The full traceback is:  
Traceback (most recent call last):  
File “C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1454428251.01-120917033280940\ec2\_ami\_find.ps1”, line 484, in   
import grp  
ImportError: No module named grp

fatal: [aws-win-host]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_name”: “ec2\_ami\_find”}, “parsed”: false}

Thanks,  
Balaji

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 2, 2016, 5:09pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/6 "2016-02-02T17:09:14Z")

</div>

I am not familiar with the ec2 modules but I imagine that you need to run them on the ansible controller by using delegate\_to: localhost as the scripting language used by ansible on windows hostsis powershell, not python.

I suggest reading [http://docs.ansible.com/playbooks\_delegation.html](http://docs.ansible.com/playbooks_delegation.html)

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 2, 2016, 5:26pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/7 "2016-02-02T17:26:42Z")

</div>

Looks like this is the github issue for tracking this: [https://github.com/ansible/ansible/issues/14233](https://github.com/ansible/ansible/issues/14233)

---

<div class="post-metadata">

**Author:** ![sbrelsfoard](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@sbrelsfoard](https://forum.ansible.com/u/sbrelsfoard)\
**Post date:** [October 13, 2016, 5:15pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/8 "2016-10-13T17:15:44Z")

</div>

Balaji Chandrababu,  
Did you ever figure out a resolution to this issue? I’m having the same problem and not coming up with any solutions.  
Thanks,  
Sam

---

<div class="post-metadata">

**Author:** ![Sayali\_Patki](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Sayali\_Patki](https://forum.ansible.com/u/Sayali_Patki)\
**Post date:** [March 21, 2017, 9:30am UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/9 "2017-03-21T09:30:47Z")

</div>

Hi, I am facing same issue. Have you found the solution?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 21, 2017, 9:40am UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/10 "2017-03-21T09:40:22Z")

</div>

This is a very old thread, the original issue described here was fixed before ansible 2.0 was released (over a year ago now).

What version of ansible are you using? Are you running from source?

If you can share a specific playbook that isn’t working I can help (I use ansible against windows all the time).

Jon

---

<div class="post-metadata">

**Author:** ![Sayali\_Patki](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Sayali\_Patki](https://forum.ansible.com/u/Sayali_Patki)\
**Post date:** [March 21, 2017, 11:42am UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/11 "2017-03-21T11:42:57Z")

</div>

Thanks for the quick responce

I am new to ansible and to download some files from s3 bucket, using s3 module.  
Ansible version 2.2.1.0

Error :

an exception occurred during task execution. The full traceback is:  
At line:4 char:1

- /usr/bin/python 'C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-149008935 …
- 

```auto

```

fatal: [[ec2-52-200-207-123.compute-1.amazonaws.com](http://ec2-52-200-207-123.compute-1.amazonaws.com/)]: FAILED! =\> {

“changed”: false,  
“failed”: true,  
“invocation”: {

“module\_name”: “s3”

},  
“msg”: “The term ‘/usr/bin/python’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”  
}

my playbook:

- name: Downloading TcRS base kits from S3

s3:  
bucket: “{{s3\_bucket\_app\_kits}}”  
object: “{{zip\_base\_kit\_1\_wnt}}”  
dest: “{{dir\_base\_loc}}”  
mode: get

Is it correct or is there any different module for windows?

Thanks,  
Sayali

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 21, 2017, 1:14pm UTC](https://forum.ansible.com/t/current-devel-branch-does-not-work-on-windows/19233/12 "2017-03-21T13:14:15Z")

</div>

Windows modules use powershell, not python so this won’t work straight onto a windows machine.

You might be able to work around it by downloading from s3 to your ansible controller and then using win\_copy to copy whatever it is you want to your windows machines. But a module would save you downloading to an intermediate machine first.
