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?
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.
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
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.
Thanks, I’ll have to read up some more on this topic. I appreciate your clarification.