From 37e757286dade76b0305667d508114d6387c6a3d Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 18 Jul 2017 17:09:32 -0700 Subject: [PATCH] Add module_utils example next to library examples (#25390) --- docs/docsite/rst/playbooks_best_practices.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/docsite/rst/playbooks_best_practices.rst b/docs/docsite/rst/playbooks_best_practices.rst index edb70b5a56f..4ad406cb236 100644 --- a/docs/docsite/rst/playbooks_best_practices.rst +++ b/docs/docsite/rst/playbooks_best_practices.rst @@ -37,6 +37,7 @@ The top level of the directory would contain files and directories like so:: hostname2 # "" library/ # if any custom modules, put them here (optional) + module_utils/ # if any custom module_utils to support modules, put them here (optional) filter_plugins/ # if any custom filter plugins, put them here (optional) site.yml # master playbook @@ -61,6 +62,7 @@ The top level of the directory would contain files and directories like so:: meta/ # main.yml # <-- role dependencies library/ # roles can also include custom modules + module_utils/ # roles can also include custom module_utils lookup_plugins/ # or other types of plugins, like lookup in this case webtier/ # same kind of structure as "common" was above, done for the webtier role @@ -96,6 +98,7 @@ Alternatively you can put each inventory file with its ``group_vars``/``host_var stagehost2 # "" library/ + module_utils/ filter_plugins/ site.yml @@ -421,7 +424,7 @@ This will pull in variables based on the OS name. Bundling Ansible Modules With Playbooks +++++++++++++++++++++++++++++++++++++++ -If a playbook has a "./library" directory relative to its YAML file, this directory can be used to add ansible modules that will +If a playbook has a :file:`./library` directory relative to its YAML file, this directory can be used to add ansible modules that will automatically be in the ansible module path. This is a great way to keep modules that go with a playbook together. This is shown in the directory structure example at the start of this section.