Hi,
I am trying to develop ansible modules for windows target machines. I don’t know how to import them in my playbooks. Should I need to edit the config file? Can anybody help me?
Hi,
I am trying to develop ansible modules for windows target machines. I don’t know how to import them in my playbooks. Should I need to edit the config file? Can anybody help me?
You should just be able to put your custom modules in your /etc/ansible/library folder and they will become available to your playbooks.
I think you have to have a module_name.ps1 and a module_name.py in /etc/ansible/library (the .py file is just used for documentation, but I think ansible might expect it.
Also I think module names need to be unque, so make sure your module doesn’t have the same file name as an existing module (unless you want your custom module to be used instead of the supplied module - modules in /etc/ansible/library are used if present.
Hope this helps.
Jon
You can also place them in a directory named library/ next to your playbooks- this is usually the way I tell people to do it, so your modules can be versioned alongside your content.
The .py doc file is not required anymore (it was at one point), but strongly encouraged so that ansible-doc will work for your modules the same way as for “in the box” modules.