On 28/04/14 10:56, Petros Moisiadis wrote: > Hello, > > I know about a ./library path that can exist at the playbook level, but > I did not find any reference to a ./library path at role level. Is there > any reason why this is not supported? Would it be a desirable feature? > It seems to be the most sensible way to allow distribution of ansible > modules along with roles. The use case is that you write a role along > with some special modules needed for that role and want to distribute > your role with all needed pieces included. > Note that library/ is for *modules*, that is, remotely executed code. There's other "kind" of modules: the action_plugins. They are run in the control machine (the host running ansible) and not remotely.
Action plugins also need a module file in library/ but the implementation is done in other file (lib/ansible/runner/action_plugins/...), and is quite different. The module file is used to expose the action plugin. The difference between both types is not appreciated from outside, but the internals are completely different. Action plugins and modules are both mixed in the "all modules" page of ansible documentation. Action plugins are not officially/explicitly supported in roles, but I've found them quite useful for several use cases. Here's one of my implementations with an explanation of the limitations/difficulties found and how I've workaround them - https://github.com/sbitmedia/ansible-monit/blob/master/README.md I'm coming from puppet and this is how I've managed to bring to ansible world some pieces I missed. Hope my experience, helps someone :) -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5360E81A.8040607%40faita.net. For more options, visit https://groups.google.com/d/optout.
