diff --git a/docs/docsite/rst/plugins/action.rst b/docs/docsite/rst/plugins/action.rst index 60b2946f1e..93c4e4bab8 100644 --- a/docs/docsite/rst/plugins/action.rst +++ b/docs/docsite/rst/plugins/action.rst @@ -1,3 +1,5 @@ +.. _action_plugins: + Action Plugins ============== @@ -12,19 +14,19 @@ The 'normal' action plugin is used for modules that do not already have an actio .. _enabling_action: -Enabling Action Plugins +Enabling action plugins ----------------------- You can enable a custom action plugin by either dropping it into the ``action_plugins`` directory adjacent to your play, inside a role, or by putting it in one of the action plugin directory sources configured in :ref:`ansible.cfg `. .. _using_action: -Using Action Plugins +Using action plugins -------------------- Action plugin are executed by default when an associated module is used; no action is required. -Plugin List +Plugin list ----------- You cannot list action plugins directly, they show up as their counterpart modules: @@ -34,19 +36,19 @@ Use ``ansible-doc `` to see specific documentation and examples, this shou .. seealso:: - :doc:`cache` + :ref:`cache_plugins` Ansible Cache plugins - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins - :doc:`connection` + :ref:`connection_plugins` Ansible connection plugins - :doc:`inventory` + :ref:`inventory_plugins` Ansible inventory plugins - :doc:`shell` + :ref:`shell_plugins` Ansible Shell plugins - :doc:`strategy` + :ref:`strategy_plugins` Ansible Strategy plugins - :doc:`vars` + :ref:`vars_plugins` Ansible Vars plugins `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/plugins/cache.rst b/docs/docsite/rst/plugins/cache.rst index bff7fc161f..66ffbc30e5 100644 --- a/docs/docsite/rst/plugins/cache.rst +++ b/docs/docsite/rst/plugins/cache.rst @@ -1,13 +1,16 @@ -.. contents:: Topics - +.. _cache_plugins: Cache Plugins ============= +.. contents:: + :local: + :depth: 2 + Cache plugin implement a backend caching mechanism that allows Ansible to store gathered facts or inventory source data without the performance hit of retrieving them from source. -The default cache plugin is the :doc:`memory ` plugin, which only caches the data for the current execution of Ansible. Other plugins with persistent storage are available to allow caching the data across runs. +The default cache plugin is the :ref:`memory ` plugin, which only caches the data for the current execution of Ansible. Other plugins with persistent storage are available to allow caching the data across runs. You can use a separate cache plugin for inventory and facts. If an inventory-specific cache plugin is not provided and inventory caching is enabled, the fact cache plugin is used for inventory. @@ -110,19 +113,19 @@ Use ``ansible-doc -t cache `` to see specific documentation and exa .. seealso:: - :doc:`action` + :ref:`action_plugins` Ansible Action plugins - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins - :doc:`connection` + :ref:`connection_plugins` Ansible connection plugins - :doc:`inventory` + :ref:`inventory_plugins` Ansible inventory plugins - :doc:`shell` + :ref:`shell_plugins` Ansible Shell plugins - :doc:`strategy` + :ref:`strategy_plugins` Ansible Strategy plugins - :doc:`vars` + :ref:`vars_plugins` Ansible Vars plugins `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/plugins/callback.rst b/docs/docsite/rst/plugins/callback.rst index a4b91eec2f..b3a5dbd373 100644 --- a/docs/docsite/rst/plugins/callback.rst +++ b/docs/docsite/rst/plugins/callback.rst @@ -1,8 +1,11 @@ -.. contents:: Topics - +.. _callback_plugins: Callback Plugins ----------------- +================ + +.. contents:: + :local: + :depth: 2 Callback plugins enable adding new behaviors to Ansible when responding to events. By default, callback plugins control most of the output you see when running the command line programs, @@ -10,19 +13,18 @@ but can also be used to add additional output, integrate with other tools and ma .. _callback_examples: -Example Callback Plugins -++++++++++++++++++++++++ +Example callback plugins +------------------------ -The :doc:`log_plays ` callback is an example of how to record playbook events to a log file, -and the :doc:`mail ` callback sends email on playbook failures. - -The :doc:`osx_say ` callback responds with computer synthesized speech on macOS in relation to playbook events. +The :ref:`log_plays ` callback is an example of how to record playbook events to a log file, +and the :ref:`mail ` callback sends email on playbook failures. +The :ref:`osx_say ` callback responds with computer synthesized speech on macOS in relation to playbook events. .. _enabling_callbacks: -Enabling Callback Plugins -++++++++++++++++++++++++++ +Enabling callback plugins +------------------------- You can activate a custom callback by either dropping it into a ``callback_plugins`` directory adjacent to your play, inside a role, or by putting it in one of the callback directory sources configured in :ref:`ansible.cfg `. @@ -34,9 +36,8 @@ Most callbacks shipped with Ansible are disabled by default and need to be white #callback_whitelist = timer, mail, profile_roles - -Managing stdout -``````````````` +Setting a callback plugin for ``ansible-playbook`` +-------------------------------------------------- You can only have one plugin be the main manager of your console output. If you want to replace the default, you should define CALLBACK_TYPE = stdout in the subclass and then configure the stdout plugin in :ref:`ansible.cfg `. For example: @@ -52,8 +53,8 @@ or for my custom callback: This only affects :ref:`ansible-playbook` by default. -Managing AdHoc -`````````````` +Setting a callback plugin for ad-hoc commands +--------------------------------------------- The :ref:`ansible` ad hoc command specifically uses a different callback plugin for stdout, so there is an extra setting in :ref:`ansible_configuration_settings` you need to add to use the stdout callback defined above: @@ -72,13 +73,12 @@ You can also set this as an environment variable: .. _callback_plugin_list: -Plugin List -+++++++++++ +Plugin list +----------- You can use ``ansible-doc -t callback -l`` to see the list of available plugins. Use ``ansible-doc -t callback `` to see specific documents and examples. - .. toctree:: :maxdepth: 1 :glob: @@ -87,19 +87,19 @@ Use ``ansible-doc -t callback `` to see specific documents and exam .. seealso:: - :doc:`action` + :ref:`action_plugins` Ansible Action plugins - :doc:`cache` + :ref:`cache_plugins` Ansible cache plugins - :doc:`connection` + :ref:`connection_plugins` Ansible connection plugins - :doc:`inventory` + :ref:`inventory_plugins` Ansible inventory plugins - :doc:`shell` + :ref:`shell_plugins` Ansible Shell plugins - :doc:`strategy` + :ref:`strategy_plugins` Ansible Strategy plugins - :doc:`vars` + :ref:`vars_plugins` Ansible Vars plugins `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/plugins/connection.rst b/docs/docsite/rst/plugins/connection.rst index f914fe3908..02d2ffb4c1 100644 --- a/docs/docsite/rst/plugins/connection.rst +++ b/docs/docsite/rst/plugins/connection.rst @@ -1,7 +1,11 @@ -.. contents:: Topics +.. _connection_plugins: Connection Plugins ------------------- +================== + +.. contents:: + :local: + :depth: 2 Connection plugins allow Ansible to connect to the target hosts so it can execute tasks on them. Ansible ships with many connection plugins, but only one can be used per host at a time. @@ -11,28 +15,28 @@ The basics of these connection types are covered in the :ref:`getting started`, at the command line (``-c``, ``--connection``), as a :ref:`keyword ` in your play, or by setting a :ref:`variable`, most often in your inventory. -For example, for Windows machines you might want to use the :doc:`winrm` plugin. +You can set the connection plugin globally via :ref:`configuration`, at the command line (``-c``, ``--connection``), as a :ref:`keyword ` in your play, or by setting a :ref:`variable`, most often in your inventory. +For example, for Windows machines you might want to set the :ref:`winrm ` plugin as an inventory variable. -Most connection plugins can operate with a minimum configuration. By default they use the :ref:`inventory hostname` and defaults to find the target host. +Most connection plugins can operate with minimal configuration. By default they use the :ref:`inventory hostname` and defaults to find the target host. Plugins are self-documenting. Each plugin should document its configuration options. The following are connection variables common to most connection plugins: @@ -48,7 +52,7 @@ Each plugin might also have a specific version of a variable that overrides the .. _connection_plugin_list: Plugin List -+++++++++++ +----------- You can use ``ansible-doc -t connection -l`` to see the list of available plugins. Use ``ansible-doc -t connection `` to see detailed documentation and examples. @@ -64,7 +68,7 @@ Use ``ansible-doc -t connection `` to see detailed documentation an :ref:`Working with Playbooks` An introduction to playbooks - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins :ref:`Filters` Jinja2 filter plugins @@ -72,7 +76,7 @@ Use ``ansible-doc -t connection `` to see detailed documentation an Jinja2 test plugins :ref:`Lookups` Jinja2 lookup plugins - :doc:`vars` + :ref:`vars_plugins` Ansible vars plugins `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/plugins/inventory.rst b/docs/docsite/rst/plugins/inventory.rst index 7b867e8e84..6d53c12d06 100644 --- a/docs/docsite/rst/plugins/inventory.rst +++ b/docs/docsite/rst/plugins/inventory.rst @@ -1,16 +1,18 @@ -.. contents:: Topics - .. _inventory_plugins: Inventory Plugins ================= +.. contents:: + :local: + :depth: 2 + Inventory plugins allow users to point at data sources to compile the inventory of hosts that Ansible uses to target tasks, either via the ``-i /path/to/file`` and/or ``-i 'host1, host2'`` command line parameters or from other configuration sources. .. _enabling_inventory: -Enabling Inventory Plugins +Enabling inventory plugins -------------------------- Most inventory plugins shipped with Ansible are disabled by default and need to be whitelisted in your @@ -32,7 +34,7 @@ This list also establishes the order in which each plugin tries to parse an inve .. _using_inventory: -Using Inventory Plugins +Using inventory plugins ----------------------- The only requirement for using an inventory plugin after it is enabled is to provide an inventory source to parse. @@ -109,7 +111,7 @@ If a host does not have the variables in the configuration above (i.e. ``tags.Na Plugin List ----------- -You can use ``ansible-doc -t inventory -l`` to see the list of available plugins. +You can use ``ansible-doc -t inventory -l`` to see the list of available plugins. Use ``ansible-doc -t inventory `` to see plugin-specific documentation and examples. .. toctree:: :maxdepth: 1 @@ -121,9 +123,9 @@ Use ``ansible-doc -t inventory `` to see plugin-specific documentat :ref:`about_playbooks` An introduction to playbooks - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins - :doc:`connection` + :ref:`connection_plugins` Ansible connection plugins :ref:`playbooks_filters` Jinja2 filter plugins @@ -131,7 +133,7 @@ Use ``ansible-doc -t inventory `` to see plugin-specific documentat Jinja2 test plugins :ref:`playbooks_lookups` Jinja2 lookup plugins - :doc:`vars` + :ref:`vars_plugins` Ansible vars plugins `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/plugins/lookup.rst b/docs/docsite/rst/plugins/lookup.rst index 6ff4ded2c4..4c509057e1 100644 --- a/docs/docsite/rst/plugins/lookup.rst +++ b/docs/docsite/rst/plugins/lookup.rst @@ -1,9 +1,11 @@ -.. contents:: Topics - .. _lookup_plugins: Lookup Plugins --------------- +============== + +.. contents:: + :local: + :depth: 2 Lookup plugins allow Ansible to access data from outside sources. This can include reading the filesystem in addition to contacting external datastores and services. @@ -26,16 +28,16 @@ Lookups are an Ansible-specific extension to the Jinja2 templating language. .. _enabling_lookup: -Enabling Lookup Plugins -+++++++++++++++++++++++ +Enabling lookup plugins +----------------------- You can activate a custom lookup by either dropping it into a ``lookup_plugins`` directory adjacent to your play, inside a role, or by putting it in one of the lookup directory sources configured in :ref:`ansible.cfg `. .. _using_lookup: -Using Lookup Plugins -++++++++++++++++++++ +Using lookup plugins +-------------------- Lookup plugins can be used anywhere you can use templating in Ansible: in a play, in variables file, or in a Jinja2 template for the :ref:`template ` module. @@ -45,7 +47,7 @@ Lookup plugins can be used anywhere you can use templating in Ansible: in a play file_contents: "{{lookup('file', 'path/to/file.txt')}}" Lookups are an integral part of loops. Wherever you see ``with_``, the part after the underscore is the name of a lookup. -This is also the reason most lookups output lists and take lists as input; for example, ``with_items`` uses the :doc:`items ` lookup: +This is also the reason most lookups output lists and take lists as input; for example, ``with_items`` uses the :ref:`items ` lookup: .. code-block:: yaml @@ -108,15 +110,15 @@ Fatal error (the default):: .. _query: -query -+++++ +Invoking lookup plugins with ``query`` +-------------------------------------- .. versionadded:: 2.5 In Ansible 2.5, a new jinja2 function called ``query`` was added for invoking lookup plugins. The difference between ``lookup`` and ``query`` is largely that ``query`` will always return a list. The default behavior of ``lookup`` is to return a string of comma separated values. ``lookup`` can be explicitly configured to return a list using ``wantlist=True``. -This was done primarily to provide an easier and more consistent interface for interacting with the new ``loop`` keyword, while maintaining backwards compatibiltiy with other uses of ``lookup``. +This was done primarily to provide an easier and more consistent interface for interacting with the new ``loop`` keyword, while maintaining backwards compatibility with other uses of ``lookup``. The following examples are equivalent:: @@ -133,8 +135,8 @@ Additionally, ``q`` was introduced as a shortform of ``query``:: .. _lookup_plugins_list: -Plugin List -+++++++++++ +Plugin list +----------- You can use ``ansible-doc -t lookup -l`` to see the list of available plugins. Use ``ansible-doc -t lookup `` to see specific documents and examples. @@ -148,9 +150,9 @@ You can use ``ansible-doc -t lookup -l`` to see the list of available plugins. U :ref:`about_playbooks` An introduction to playbooks - :doc:`inventory` + :ref:`inventory_plugins` Ansible inventory plugins - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins :ref:`playbooks_filters` Jinja2 filter plugins diff --git a/docs/docsite/rst/plugins/plugins.rst b/docs/docsite/rst/plugins/plugins.rst index 515c4843e9..2a7d3c2fea 100644 --- a/docs/docsite/rst/plugins/plugins.rst +++ b/docs/docsite/rst/plugins/plugins.rst @@ -10,7 +10,7 @@ Ansible ships with a number of handy plugins, and you can easily write your own. This section covers the various types of plugins that are included with Ansible: -.. toctree:: +.. toctree:: :maxdepth: 1 action @@ -32,7 +32,7 @@ This section covers the various types of plugins that are included with Ansible: An introduction to playbooks :ref:`ansible_configuration_settings` Ansible configuration documentation and settings - :doc:`../user_guide/command_line_tools` + :ref:`command_line_tools` Ansible tools, description and options `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/plugins/shell.rst b/docs/docsite/rst/plugins/shell.rst index 680afbf9f4..7caff1c637 100644 --- a/docs/docsite/rst/plugins/shell.rst +++ b/docs/docsite/rst/plugins/shell.rst @@ -1,15 +1,19 @@ -.. contents:: Topics +.. _shell_plugins: Shell Plugins -------------- +============= + +.. contents:: + :local: + :depth: 2 Shell plugins work to ensure that the basic commands Ansible runs are properly formatted to work with the target machine and allow the user to configure certain behaviors related to how Ansible executes tasks. .. _enabling_shell: -Enabling Shell Plugins -++++++++++++++++++++++ +Enabling shell plugins +---------------------- You can add a custom shell plugin by dropping it into a ``shell_plugins`` directory adjacent to your play, inside a role, or by putting it in one of the shell plugin directory sources configured in :ref:`ansible.cfg `. @@ -19,8 +23,8 @@ or by putting it in one of the shell plugin directory sources configured in :ref .. _using_shell: -Using Shell Plugins -+++++++++++++++++++ +Using shell plugins +------------------- In addition to the default configuration settings in :ref:`ansible_configuration_settings`, you can use the connection variable :ref:`ansible_shell_type ` to select the plugin to use. @@ -36,17 +40,17 @@ detailed in the plugin themselves (linked below). .. seealso:: - :doc:`../user_guide/playbooks` + :ref:`about_playbooks` An introduction to playbooks - :doc:`inventory` + :ref:`inventory_plugins` Ansible inventory plugins - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins - :doc:`../user_guide/playbooks_filters` + :ref:`playbooks_filters` Jinja2 filter plugins - :doc:`../user_guide/playbooks_tests` + :ref:`playbooks_tests` Jinja2 test plugins - :doc:`../user_guide/playbooks_lookups` + :ref:`playbooks_lookups` Jinja2 lookup plugins `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/plugins/strategy.rst b/docs/docsite/rst/plugins/strategy.rst index 784e3ddcb9..5e7d6c99ac 100644 --- a/docs/docsite/rst/plugins/strategy.rst +++ b/docs/docsite/rst/plugins/strategy.rst @@ -1,27 +1,29 @@ -.. contents:: Topics - +.. _strategy_plugins: Strategy Plugins ----------------- +================ + +.. contents:: + :local: + :depth: 2 Strategy plugins control the flow of play execution by handling task and host scheduling. .. _enable_strategy: -Enabling Strategy Plugins -+++++++++++++++++++++++++ +Enabling strategy plugins +------------------------- -Strategy plugins shipped with Ansible are enabled by default. You can enable a custom strategy plugin by +All strategy plugins shipped with Ansible are enabled by default. You can enable a custom strategy plugin by putting it in one of the lookup directory sources configured in :ref:`ansible.cfg `. - .. _using_strategy: -Using Strategy Plugins -++++++++++++++++++++++ +Using strategy plugins +---------------------- Only one strategy plugin can be used in a play, but you can use different ones for each play in a playbook or ansible run. -The default is the :doc:`linear ` plugin. You can change this default in Ansible :ref:`configuration ` using an environment variable: +The default is the :ref:`linear ` plugin. You can change this default in Ansible :ref:`configuration ` using an environment variable: .. code-block:: shell @@ -50,10 +52,10 @@ You can also specify the strategy plugin in the play via the :ref:`strategy keyw .. _strategy_plugin_list: -Plugin List -+++++++++++ +Plugin list +----------- -You can use ``ansible-doc -t strategy -l`` to see the list of available plugins. +You can use ``ansible-doc -t strategy -l`` to see the list of available plugins. Use ``ansible-doc -t strategy `` to see plugin-specific specific documentation and examples. @@ -66,9 +68,9 @@ Use ``ansible-doc -t strategy `` to see plugin-specific specific do :ref:`about_playbooks` An introduction to playbooks - :doc:`inventory` + :ref:`inventory_plugins` Ansible inventory plugins - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins :ref:`playbooks_filters` Jinja2 filter plugins diff --git a/docs/docsite/rst/plugins/vars.rst b/docs/docsite/rst/plugins/vars.rst index b7dd2eb153..8596fcc9c9 100644 --- a/docs/docsite/rst/plugins/vars.rst +++ b/docs/docsite/rst/plugins/vars.rst @@ -1,8 +1,11 @@ -.. contents:: Topics - +.. _vars_plugins: Vars Plugins ------------- +============ + +.. contents:: + :local: + :depth: 2 Vars plugins inject additional variable data into Ansible runs that did not come from an inventory source, playbook, or command line. Playbook constructs like 'host_vars' and 'group_vars' work using vars plugins. @@ -13,16 +16,16 @@ The :ref:`host_group_vars ` plugin shipped with Ansible en .. _enable_vars: -Enabling Vars Plugins -+++++++++++++++++++++ +Enabling vars plugins +--------------------- You can activate a custom vars plugin by either dropping it into a ``vars_plugins`` directory adjacent to your play, inside a role, or by putting it in one of the directory sources configured in :ref:`ansible.cfg `. .. _using_vars: -Using Vars Plugins -++++++++++++++++++ +Using vars plugins +------------------ Vars plugins are used automatically after they are enabled. @@ -30,9 +33,9 @@ Vars plugins are used automatically after they are enabled. .. _vars_plugin_list: Plugin Lists -++++++++++++ +------------ -You can use ``ansible-doc -t vars -l`` to see the list of available plugins. +You can use ``ansible-doc -t vars -l`` to see the list of available plugins. Use ``ansible-doc -t vars `` to see specific plugin-specific documentation and examples. @@ -43,19 +46,19 @@ Use ``ansible-doc -t vars `` to see specific plugin-specific docume .. seealso:: - :doc:`action` + :ref:`action_plugins` Ansible Action plugins - :doc:`cache` + :ref:`cache_plugins` Ansible Cache plugins - :doc:`callback` + :ref:`callback_plugins` Ansible callback plugins - :doc:`connection` + :ref:`connection_plugins` Ansible connection plugins - :doc:`inventory` + :ref:`inventory_plugins` Ansible inventory plugins - :doc:`shell` + :ref:`shell_plugins` Ansible Shell plugins - :doc:`strategy` + :ref:`strategy_plugins` Ansible Strategy plugins `User Mailing List `_ Have a question? Stop by the google group! diff --git a/docs/docsite/rst/user_guide/command_line_tools.rst b/docs/docsite/rst/user_guide/command_line_tools.rst index 115f6b3a2a..681c742455 100644 --- a/docs/docsite/rst/user_guide/command_line_tools.rst +++ b/docs/docsite/rst/user_guide/command_line_tools.rst @@ -1,10 +1,12 @@ +.. _command_line_tools: + Working with Command Line Tools =============================== Most users are familiar with `ansible` and `ansible-playbook`, but those are not the only utilities Ansible provides. -Below is a complete list of Ansible utilities. Each page contains a description of the utility and a listing of supported parameters. +Below is a complete list of Ansible utilities. Each page contains a description of the utility and a listing of supported parameters. -.. toctree:: +.. toctree:: :maxdepth: 1 ../cli/ansible.rst @@ -16,4 +18,3 @@ Below is a complete list of Ansible utilities. Each page contains a description ../cli/ansible-playbook.rst ../cli/ansible-pull.rst ../cli/ansible-vault.rst - \ No newline at end of file