On 21. aug. 2017 21:52, Stiv Ostenberg wrote:
The documentation would indeed be nice, however it really doesn't go into
great detail on how plugins are loaded, when they are part of  role. In my
specific case, I used the example in _the source_ for a lookup.  I copied
their plugin code exactly (to load the data from a file to a variable)
since it is close to what I need.  I was able to run things just ducky.

Ansible has a file lookup, so you probably just used that one.


  Then I changed the name of my alleged lookup plugin to "prospectors.py"
and changed the name of the call to {{ lookup('prospectors',
'vars/prospectors/Base.yaml') }}.  It fails.  That means either my plugin
is in the wrong place (and since it is in a role that I need to be portable
it should be in the role hierarchy) or there is some reference to the name
in the code that I missed.  The documentation doesnt say anything about the
relationship between the name of the lookup plugin, and how it is called in
the playbook.  Since "file" is a built-in,  the example is not really valid.

The name of the file is the name of the plugin.

In your case it should be roles/filebeat/lookup_plugins/prospectors.py and since the plugin is in a role you need to apply the role for the plugin to be available.


--
Kai Stian Olstad

--
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/b44f02dc-c273-4d3f-ec77-ec6edc2c2c0f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to