# Running on Windows

**URL:** <https://forum.ansible.com/t/running-on-windows/11930>\
**Category:** Ansible Project\
**Tags:** windows, ansible-project\
**Created:** [September 26, 2012, 10:24pm UTC](https://forum.ansible.com/t/running-on-windows/11930 "2012-09-26T22:24:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 26, 2012, 10:24pm UTC](https://forum.ansible.com/t/running-on-windows/11930/1 "2012-09-26T22:24:08Z")

</div>

I honestly don't know.

I'm open to patches to make this possible where it makes sense unless  
it starts looking ugly.

-c ssh may work ok out of the box, I would think it might.

There is a bit on the internet about paramiko.

We do some things with files that are probably not using os.path.join  
everywhere but IIRC python is generally cool about wrong-way-slashes.

--Michael

---

<div class="post-metadata">

**Author:** ![Chamberlain\_Darren](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@Chamberlain\_Darren](https://forum.ansible.com/u/Chamberlain_Darren)\
**Post date:** [September 27, 2012, 1:49am UTC](https://forum.ansible.com/t/running-on-windows/11930/2 "2012-09-27T01:49:34Z")

</div>

I tried this a few days ago:

&nbsp;&nbsp;C:\Users\darren\>python \ansible\bin\ansible  
&nbsp;&nbsp;Traceback (most recent call last):  
&nbsp;&nbsp;&nbsp;&nbsp;File "\ansible\bin\ansible", line 25, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from ansible.runner import Runner  
&nbsp;&nbsp;&nbsp;&nbsp;File "c:\ansible\lib\ansible\runner\_\_init\_\_.py", line 21, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;import pwd  
&nbsp;&nbsp;ImportError: No module named pwd

pwd is a unix-only module, so it fails immediately. This can be  
wrapped in a try/except block, but I haven't looked into what the  
ramifications will be. And of course sshd on windows is whole other  
story.

\* Michael DeHaan \<michael.dehaan at gmail.com\> [2012/09/26 18:24]:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 27, 2012, 2:04am UTC](https://forum.ansible.com/t/running-on-windows/11930/3 "2012-09-27T02:04:54Z")

</div>

try/excepting this is totally reasonable.

I think it's going to be a matter of peeling the onion and seeing what  
happens along the way. multiprocessing fortunately claims to work on  
Windows 🙂

---

<div class="post-metadata">

**Author:** ![Giuliano\_Barberi](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Giuliano\_Barberi](https://forum.ansible.com/u/Giuliano_Barberi)\
**Post date:** [September 27, 2012, 12:09pm UTC](https://forum.ansible.com/t/running-on-windows/11930/4 "2012-09-27T12:09:32Z")

</div>

I’ll try it with Cygwin and see if it works.

Regards

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 27, 2012, 12:13pm UTC](https://forum.ansible.com/t/running-on-windows/11930/5 "2012-09-27T12:13:17Z")

</div>

> I'll try it with Cygwin and see if it works.

Thanks!

I'm pretty sure it won't do something right, what's going to be  
interesting is fixing things until it does.

I suspect there may be a handfull of things.

I'd also be interested to see if it ran under ActivePython, and how  
many changes that might take.

---

<div class="post-metadata">

**Author:** ![Giuliano\_Barberi](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Giuliano\_Barberi](https://forum.ansible.com/u/Giuliano_Barberi)\
**Post date:** [September 27, 2012, 7:43pm UTC](https://forum.ansible.com/t/running-on-windows/11930/6 "2012-09-27T19:43:50Z")

</div>

Just installed it on Cygwin and a basic ping command works fine. Haven’t tried anything more complex. Would be nice if it worked natively but this isn’t bad 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 27, 2012, 7:46pm UTC](https://forum.ansible.com/t/running-on-windows/11930/7 "2012-09-27T19:46:58Z")

</div>

> Just installed it on Cygwin and a basic ping command works fine. Haven't  
> tried anything more complex. Would be nice if it worked natively but this  
> isn't bad 🙂

Outstanding.

---

<div class="post-metadata">

**Author:** ![Giuliano\_Barberi](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Giuliano\_Barberi](https://forum.ansible.com/u/Giuliano_Barberi)\
**Post date:** [September 28, 2012, 5:55pm UTC](https://forum.ansible.com/t/running-on-windows/11930/8 "2012-09-28T17:55:55Z")

</div>

I have an SSH daemon on Windows using CopSSH and was trying to run some simple commands from Ansible. It was able to connect and create the /home/user/.ansible folder but couldn’t send the file over with the command. I didn’t try with plain SSH but I am curious as to what mechanism Ansible w/ Paramiko uses to transfer files?

Regards

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 28, 2012, 6:10pm UTC](https://forum.ansible.com/t/running-on-windows/11930/9 "2012-09-28T18:10:21Z")

</div>

It uses sftp.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 28, 2012, 6:12pm UTC](https://forum.ansible.com/t/running-on-windows/11930/10 "2012-09-28T18:12:21Z")

</div>

I don't have the resources to look into this right \*now\*, but I'd be  
VERY curious if a native WMI transport was possible to add. I'm sure  
it is.

We don't really have a lot of modules for managing OS X, so I can't  
assume Windows would be an immediate thing, but some basic control  
seems like it would be super easy to do, and we could probably retain  
our ability to not require any (non-native) daemons if done correctly.

Most modules in core use python, obviously, but there's nothing saying  
there couldn't be some powershell daemons on the side with a "win\_foo"  
prefix.

--Michael

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 28, 2012, 6:12pm UTC](https://forum.ansible.com/t/running-on-windows/11930/11 "2012-09-28T18:12:46Z")

</div>

> > > I have an SSH daemon on Windows using CopSSH and was trying to run some  
> > > simple commands from Ansible. It was able to connect and create the  
> > > /home/user/.ansible folder but couldn't send the file over with the command.  
> > > I didn't try with plain SSH but I am curious as to what mechanism Ansible w/  
> > > Paramiko uses to transfer files?
> > 
> > It uses sftp.
> 
> I don't have the resources to look into this right \*now\*, but I'd be  
> VERY curious if a native WMI transport was possible to add. I'm sure  
> it is.
> 
> We don't really have a lot of modules for managing OS X, so I can't  
> assume Windows would be an immediate thing, but some basic control  
> seems like it would be super easy to do, and we could probably retain  
> our ability to not require any (non-native) daemons if done correctly.
> 
> Most modules in core use python, obviously, but there's nothing saying  
> there couldn't be some powershell daemons on the side with a "win\_foo"  
> prefix.

Correction -- I don't mean "daemons" here, I mean modules.

---

<div class="post-metadata">

**Author:** ![Giuliano\_Barberi](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Giuliano\_Barberi](https://forum.ansible.com/u/Giuliano_Barberi)\
**Post date:** [September 28, 2012, 7:21pm UTC](https://forum.ansible.com/t/running-on-windows/11930/12 "2012-09-28T19:21:21Z")

</div>

Do you know of any resources about how to remotely run commands from linux → win?

I see this here that seems easy to use: [http://mpov.timmorgan.org/winexe-on-ubuntu](http://mpov.timmorgan.org/winexe-on-ubuntu)

Regards

---

<div class="post-metadata">

**Author:** ![Giuliano\_Barberi](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Giuliano\_Barberi](https://forum.ansible.com/u/Giuliano_Barberi)\
**Post date:** [September 29, 2012, 1:19am UTC](https://forum.ansible.com/t/running-on-windows/11930/13 "2012-09-29T01:19:50Z")

</div>

Got a basic ping/pong command to work by doing an openssh install with Cygwin instead of using the prepackaged ssh servers for Windows. Very neat.

---

<div class="post-metadata">

**Author:** ![Giuliano\_Barberi](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Giuliano\_Barberi](https://forum.ansible.com/u/Giuliano_Barberi)\
**Post date:** [November 21, 2012, 2:31am UTC](https://forum.ansible.com/t/running-on-windows/11930/14 "2012-11-21T02:31:30Z")

</div>

I used the python install from Cygwin and not the one from Windows.

---

<div class="post-metadata">

**Author:** ![Peder\_Jakobsen](https://avatars.discourse-cdn.com/v4/letter/p/3bc359/32.png) [@Peder\_Jakobsen](https://forum.ansible.com/u/Peder_Jakobsen)\
**Post date:** [November 21, 2012, 12:57pm UTC](https://forum.ansible.com/t/running-on-windows/11930/15 "2012-11-21T12:57:31Z")

</div>

> I used the python install from Cygwin and not the one from Windows.

Thanks, works great now.

For the sake of the project gaining more traction, it would be good to be able to easily install Ansible on Windows

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [November 21, 2012, 2:19pm UTC](https://forum.ansible.com/t/running-on-windows/11930/16 "2012-11-21T14:19:24Z")

</div>

> Thanks, works great now.
> 
> For the sake of the project gaining more traction, it would be good to be  
> able to easily install Ansible on Windows

I would love to lose some traction 🙂

---

<div class="post-metadata">

**Author:** ![Peder\_Jakobsen](https://avatars.discourse-cdn.com/v4/letter/p/3bc359/32.png) [@Peder\_Jakobsen](https://forum.ansible.com/u/Peder_Jakobsen)\
**Post date:** [November 21, 2012, 2:21pm UTC](https://forum.ansible.com/t/running-on-windows/11930/17 "2012-11-21T14:21:15Z")

</div>

> > Thanks, works great now.
> > 
> > For the sake of the project gaining more traction, it would be good to be  
> > able to easily install Ansible on Windows
> 
> I would love to lose some traction 🙂

LOL. Does this mean that you have a regular day job and are just rolling this on the side for fun?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [November 21, 2012, 2:37pm UTC](https://forum.ansible.com/t/running-on-windows/11930/18 "2012-11-21T14:37:54Z")

</div>

> LOL. Does this mean that you have a regular day job and are just rolling  
> this on the side for fun?

Not entirely for fun (I really needed a more manageable Func and a  
simpler Linux CMS, and wanted to solve deployment problems for future  
use), but it's not a business. I do use many pieces of Ansible, but  
not as much as many folks on this list -- but yes, we've achieved so  
much growth that I wouldn't mind accelerating a bit less! Thankfully  
I think the core is \*mostly\* done and most of our future activity is  
going to revolve around modules and keeping up with the distros.

If you want it to work well as a client program on Windows, the best  
way to do that is figure out how and make it happen. I don't think  
we'll ever  
be managing Windows machines in the core code, that seems very  
round-peg, square-hole, and would detract from the core mission.  
Though if  
there's a patch here and there to make Cygwin happier, or a line or  
two to put into the docs (docsite/rst/\*.rst in the main project) that  
would be good  
to have.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [November 21, 2012, 2:41pm UTC](https://forum.ansible.com/t/running-on-windows/11930/19 "2012-11-21T14:41:38Z")

</div>

Soo no integration with the MMC anytime soon?

---

<div class="post-metadata">

**Author:** ![Peder\_Jakobsen](https://avatars.discourse-cdn.com/v4/letter/p/3bc359/32.png) [@Peder\_Jakobsen](https://forum.ansible.com/u/Peder_Jakobsen)\
**Post date:** [November 21, 2012, 2:44pm UTC](https://forum.ansible.com/t/running-on-windows/11930/20 "2012-11-21T14:44:17Z")

</div>

Ofcourse! It’s obnoxious to expect an open source project to just give and give without giving anything back. 🙂

I’m working on a large project with people from around the world ([CKAN.org](http://CKAN.org)). It is a pylons based web app + SOLR (java) which is gaining traction quickly, and we have just started assessing Ansible as our main devops tool. Hopefully we can colloborate to give the communcity something useful in return, but in due time because we have many other fish to fry.

[Next page](https://forum.ansible.com/t/running-on-windows/11930.md?page=2)
