You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 24, 2020. It is now read-only.
Copy file name to clipboardexpand all lines: docsite/rst/playbooks_roles.rst
+14-4
Original file line number
Diff line number
Diff line change
@@ -330,13 +330,13 @@ The resulting order of execution would be as follows::
330
330
.. note::
331
331
Variable inheritance and scope are detailed in the :doc:`playbooks_variables`.
332
332
333
-
Embedding Modules In Roles
334
-
``````````````````````````
333
+
Embedding Modules and Plugins In Roles
334
+
``````````````````````````````````````
335
335
336
336
This is an advanced topic that should not be relevant for most users.
337
337
338
-
If you write a custom module (see :doc:`developing_modules`) you may wish to distribute it as part of a role. Generally speaking, Ansible as a project is very interested
339
-
in taking high-quality modules into ansible core for inclusion, so this shouldn't be the norm, but it's quite easy to do.
338
+
If you write a custom module (see :doc:`developing_modules`) or a plugin (see :doc:`developing_plugins`), you may wish to distribute it as part of a role.
339
+
Generally speaking, Ansible as a project is very interested in taking high-quality modules into ansible core for inclusion, so this shouldn't be the norm, but it's quite easy to do.
340
340
341
341
A good example for this is if you worked at a company called AcmeWidgets, and wrote an internal module that helped configure your internal software, and you wanted other
342
342
people in your organization to easily use this module -- but you didn't want to tell everyone how to configure their Ansible library path.
@@ -365,6 +365,16 @@ in production releases. This is not always advisable as API signatures may chan
365
365
way of carrying a patch against a core module, however, should you have good reason for this. Naturally the project prefers that contributions be directed back
366
366
to github whenever possible via a pull request.
367
367
368
+
The same mechanism can be used to embed and distribute plugins in a role, using the same schema. For example, for a filter plugin::
369
+
370
+
roles/
371
+
my_custom_filter/
372
+
filter_plugins
373
+
filter1
374
+
filter2
375
+
376
+
They can then be used in a template or a jinja template in any role called after 'my_custom_filter'
0 commit comments