Creating Windows modules

40 views
Skip to first unread message

skinnedknuckles

unread,
Dec 11, 2014, 5:43:01 PM12/11/14
to ansible...@googlegroups.com
Are modules intended to run on windows remote nodes required to be written in powershell script or is there a way to turn python code into a "windows" module?

Michael DeHaan

unread,
Dec 11, 2014, 8:01:37 PM12/11/14
to ansible...@googlegroups.com
They are required to be in powershell (unfortunately for those that don't like Powershell!  maybe fortunate for those that do - as it does provide a very strong 'standard library' of stuff to do on Windows that Microsoft maintains for us - so ... that's a win).   This is so we don't have to install any agents on the remote machines, and they work using Windows powershell remoting.



On Thu, Dec 11, 2014 at 5:43 PM, skinnedknuckles <andersonj...@gmail.com> wrote:
Are modules intended to run on windows remote nodes required to be written in powershell script or is there a way to turn python code into a "windows" module?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/aa18830a-30d9-483e-b446-e0562491ddd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Anderson

unread,
Dec 15, 2014, 6:29:40 PM12/15/14
to ansible...@googlegroups.com
Thanks, that's good to know.

Would it be worth the effort to add something like, "Modules for remote nodes running on Windows must be written as powershell scripts and be run with the ansible "script" module through Windows powershell remoting." or something like that in the documentation?  It seems like it would fit nicely here and/or here?  That information maybe documented elsewhere but if so I missed it.  Just a thought.

Jonathan

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/hoD6YHH3Ppw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.

Matt Martz

unread,
Dec 15, 2014, 8:02:14 PM12/15/14
to ansible...@googlegroups.com
There is no requirement that all windows modules must be run via the script module.

Just as the *nix modules are written in Python, the Windows modules are written in powershell.

I'm not sure if you are familiar with how the Python modules work, but they are shipped to the remote node and executed.  This is the same way as the Windows powershell modules. The only difference is that windows modules must contain both a ps1 (powershell) file and a py (Python) file.  The py files contains the docs for the module.

I may have misunderstood what you meant, but written the way you mention, it doesn't sound correct.

For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Jonathan Anderson

unread,
Dec 16, 2014, 1:12:14 PM12/16/14
to ansible...@googlegroups.com
Thanks, I'll have to read up some more on this topic.  I appreciate your clarification.

Reply all
Reply to author
Forward
0 new messages