Windows module - including PS script before transfering to the remote.

Hello all!

I’m writing a number of Powershell Ansible modules and facing an issue.
Say you have a module A and a module B and some functions defined in include.ps1.
I would like module A and B to include include.ps1.

My understanding is Ansible will transfer only module A. Which means a regular include will fail because include.ps1 won’t be on the remote.
Is it possible to make Ansible to include “include.ps1” in the module A before transfering it to the remote?

Would be super convenient. At the moment I have to copy/paste include.ps1 in module A, B and so on.
As you can imagine this leads to a number of problems :slight_smile:

Thanks!

There’s some stuff coming in 2.3 that will help address this- the Windows exec wrapper is getting completely overhauled, and one of the new things it can do is include arbitrary PS module files from the controller along with the Ansible module code (instead of just module_utils/powershell.ps1 like today). The *nix module subsystem is getting support for pluggable module_utils (eg, add new module_utils files outside the core Ansible install), and if I have time, I’ll add the same support to the Windows exec wrapper (if not, definitely for 2.4). Stay tuned for the new 2.3 exec wrapper- this should be landing in devel next week unless I run into any major blockers.

-Matt