Running on Windows

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

I tried this a few days ago:

  C:\Users\darren>python \ansible\bin\ansible
  Traceback (most recent call last):
    File "\ansible\bin\ansible", line 25, in <module>
      from ansible.runner import Runner
    File "c:\ansible\lib\ansible\runner\__init__.py", line 21, in <module>
      import pwd
  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]:

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 :slight_smile:

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

Regards

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.

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 :slight_smile:

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 :slight_smile:

Outstanding.

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

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.

--Michael

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.

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

Regards

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.

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

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

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 :slight_smile:

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 :slight_smile:

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

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.

Soo no integration with the MMC anytime soon?

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

I’m working on a large project with people from around the world (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.