Skip to content

Commit 18ae5f0

Browse files
s-herteloraNod
andauthored
Update docs/docsite/rst/playbook_guide/playbooks_intro.rst
Co-authored-by: Don Naro <[email protected]>
1 parent a633774 commit 18ae5f0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/docsite/rst/playbook_guide/playbooks_intro.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,17 @@ Play Argument Validation
160160

161161
Beginning in version 2.20, you can enable argument validation using the play keyword ``validate_argspec``. This adds a :ansplugin:`validate_argument_spec <ansible.builtin.validate_argument_spec#module>` task following play-level fact gathering. This feature is tech preview.
162162

163-
To turn on validation for a play, set ``validate_argspec`` to ``True`` to use the play ``name`` as the argument specification identifier, or set ``validate_argspec`` to a string to use instead of the play ``name``.
163+
Play argument validation has two main parts:
164164

165-
When play argument validation is enabled, a corresponding ``<playbook_name>.meta.yml`` file is required in the same directory as the playbook, and must contain a valid argument specification. This is a valid, empty argument specification named ``setup webserver`` for the playbook ``create_webserver.yml``:
165+
* The ``validate_argspec`` keyword.
166+
* A ``.meta.yml`` file that defines argument specifications.
167+
168+
To enable play argument validation you:
169+
170+
#. Define the argument specification identifier by setting a value for the ``validate_argspec`` keyword. You can set the value to ``True`` to use the play ``name`` or you can set the value to a string.
171+
#. Provide a valid argument specification in a ``<playbook_name>.meta.yml`` file in the same directory as the playbook.
172+
173+
The following example provides a valid, empty argument specification named ``setup webserver`` for the playbook ``create_webserver.yml``:
166174

167175
.. code-block:: yaml
168176

0 commit comments

Comments
 (0)