Skip to content

Commit

Permalink
Merge pull request #1283 from Devids10/clarify_example_module
Browse files Browse the repository at this point in the history
MUNI_TECH_WRITERS: Clarify example module group name in the playbook guide
  • Loading branch information
oraNod authored Apr 25, 2024
2 parents 1af3ca3 + d863f58 commit 87886f1
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions docs/docsite/rst/playbook_guide/playbooks_module_defaults.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,25 @@ In a playbook, you can set module defaults for whole groups of modules, such as
In ansible-core 2.12, collections can define their own groups in the ``meta/runtime.yml`` file. ``module_defaults`` does not take the ``collections`` keyword into account, so the fully qualified group name must be used for new groups in ``module_defaults``.

Here is an example ``runtime.yml`` file for a collection and a sample playbook using the group.
Here is an example ``runtime.yml`` file for the ``ns.coll`` collection.
This file defines an action group named ``ns.coll.my_group`` and places the ``sample_module`` from ``ns.coll`` and ``another_module`` from ``another.collection`` into the group.

.. code-block:: YAML
# collections/ansible_collections/ns/coll/meta/runtime.yml
action_groups:
groupname:
- module
- another.collection.module
# collections/ansible_collections/ns/coll/meta/runtime.yml
action_groups:
my_group:
- sample_module
- another.collection.another_module
This group can now be used in a playbook like this:

.. code-block:: YAML
- hosts: localhost
module_defaults:
group/ns.coll.groupname:
option_name: option_value
tasks:
- ns.coll.module:
- another.collection.module
- hosts: localhost
module_defaults:
group/ns.coll.my_group:
option_name: option_value
tasks:
- ns.coll.sample_module:
- another.collection.another_module:

0 comments on commit 87886f1

Please sign in to comment.