Using docker_* modules on Windows

Hi everyone,

Are docker_* modules to be expected to work on Windows?

I try to pull image like this:

`

  • name: Pull hello world image
    docker_image:
    name: hello-world:nanoserver
    docker_host: npipe://
    `

and get this error:

`

[WARNING]: FATAL ERROR DURING FILE TRANSFER: Traceback (most recent call last): File
“/usr/local/lib/python2.7/dist-packages/ansible/plugins/connection/winrm.py”, line 270, in _winrm_exec
self._winrm_send_input(self.protocol, self.shell_id, command_id, data, eof=is_last) File
“/usr/local/lib/python2.7/dist-packages/ansible/plugins/connection/winrm.py”, line 250, in
_winrm_send_input protocol.send_message(xmltodict.unparse(rq)) File “/usr/local/lib/python2.7
/dist-packages/winrm/protocol.py”, line 207, in send_message return
self.transport.send_message(message) File “/usr/local/lib/python2.7/dist-
packages/winrm/transport.py”, line 202, in send_message raise WinRMTransportError(‘http’,
error_message) WinRMTransportError: (u’http’, u’Bad HTTP response returned from server. Code 500’)

`

Am I just doing something that simply isn’t supposed to work? Or is this rather a bug?

Regards

The docker modules won't run on a Windows host as they are written in Python and Windows runs Powershell modules. The error does seem to indicate something else is wrong but you won't be able to do this regardless. Are you on a particular version or are you just running from devel?

Thanks

Jordan

Thanks, I’m running @devel.

I’m new to Ansible. I did read that running control machine on Windows is a non-goal, but do you maybe know if running python modules (given python is present) is?

It isn’t a goal at this point in time. The decision was made to use Powershell for Windows modules as that gives us the ability to tap into the .NET framework where Python would be pretty limited in.

Thanks,

It sounds like the right pragmatic decision for modules managing the node itself.

It’s just that docker is a little bit special here. It seems pretty weird to have to implement identical win_docker_* modules, since, essentially, you really need to use the same docker engine API.
I’m thinking if maybe there’s a way to manage docker on the node through remote socket with local_action’s or something like that…