Add pre-commit config file (#62)

Add pre-commit config file

Reviewed-by: https://github.com/apps/ansible-zuul
pull/56/head^2
Nathaniel Case 2021-03-31 13:43:38 -04:00 committed by GitHub
parent 0bd35af5eb
commit 4a66f0f160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 101 additions and 172 deletions

20
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,20 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch, main]
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
args: [-l, "79"]
- repo: https://github.com/ansible-network/collection_prep
rev: 0.9.1
hooks:
- id: update-docs

View File

@ -8,7 +8,7 @@ The Ansible ``ansible.utils`` collection includes a variety of plugins that aid
<!--start requires_ansible-->
## Ansible version compatibility
This collection has been tested against following Ansible versions: **>=2.9.10,<2.11**.
This collection has been tested against following Ansible versions: **>=2.9.10**.
Plugins and modules within a collection may be tested with only specific Ansible versions.
A collection may contain metadata that identifies these versions.
@ -47,11 +47,6 @@ Name | Description
--- | ---
[ansible.utils.validate](https://github.com/ansible-collections/ansible.utils/blob/main/docs/ansible.utils.validate_test.rst)|Validate data with provided criteria
### Validate plugins
Name | Description
--- | ---
[ansible.utils.jsonschema](https://github.com/ansible-collections/ansible.utils/blob/main/docs/ansible.utils.jsonschema_validate.rst)|Define configurable options for jsonschema validate plugin
<!--end collection content-->
## Installing this collection

View File

@ -438,6 +438,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>when provided a command</td>

View File

@ -124,6 +124,7 @@ Parameters
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>
@ -298,11 +299,12 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>always</td>
<td>
<div>The <code>diff_text</code> split into lines.</div>
<div>The <em>diff_text</em> split into lines.</div>
<br/>
</td>
</tr>

View File

@ -17,8 +17,8 @@ Version added: 1.0.0
Synopsis
--------
- Use a ``path`` to retrieve a nested value from a ``var``.
- ``get_path`` is also available as a ``lookup plugin`` for convenience.
- Use a *path* to retrieve a nested value from a *var*.
- **get_path** is also available as a **lookup plugin** for convenience.
- Using the parameters below- ``var|ansible.utils.get_path(path, wantlist``)
@ -51,8 +51,8 @@ Parameters
<td>
</td>
<td>
<div>The <code>path</code> in the <code>var</code> to retrieve the value of.</div>
<div>The <code>path</code> needs to be a valid jinja path.</div>
<div>The <em>path</em> in the <em>var</em> to retrieve the value of.</div>
<div>The <em>path</em> needs to be a valid jinja path.</div>
</td>
</tr>
<tr>
@ -72,7 +72,7 @@ Parameters
<td>
<div>The variable from which the value should be extracted.</div>
<div>This option represents the value that is passed to the filter plugin in pipe format.</div>
<div>For example <em>config_data|ansible.utils.get_path(</em>), in this case <em>config_data</em> represents this option.</div>
<div>For example <code>config_data|ansible.utils.get_path(</code>), in this case <code>config_data</code> represents this option.</div>
</td>
</tr>
<tr>

View File

@ -17,8 +17,8 @@ Version added: 1.0.0
Synopsis
--------
- Use a ``path`` to retrieve a nested value from a ``var``
- ``get_path`` is also available as a ``filter plugin`` for convenience
- Use a *path* to retrieve a nested value from a *var*
- **get_path** is also available as a **filter plugin** for convenience
- Using the parameters below- ``lookup('ansible.utils.get_path', var, path, wantlist``)
@ -51,7 +51,7 @@ Parameters
<td>
</td>
<td>
<div>The <code>path</code> in the <code>var</code> to retrieve the value of. The <code>path</code> needs to a be a valid jinja path.</div>
<div>The <em>path</em> in the <em>var</em> to retrieve the value of. The <em>path</em> needs to a be a valid jinja path.</div>
</td>
</tr>
<tr>

View File

@ -19,7 +19,7 @@ Synopsis
--------
- This plugin returns the indices of items matching some criteria in a list.
- When working with a list of dictionaries, the key to evaluate can be specified.
- ``index_of`` is also available as a ``lookup plugin`` for convenience.
- **index_of** is also available as a **lookup plugin** for convenience.
- Using the parameters below- ``data|ansible.utils.index_of(test, value, key, fail_on_missing, wantlist``)
@ -54,7 +54,7 @@ Parameters
<td>
<div>A list of items to enumerate and test against.</div>
<div>This option represents the value that is passed to the filter plugin in pipe format.</div>
<div>For example <em>config_data|ansible.utils.index_of(&#x27;x&#x27;</em>), in this case <em>config_data</em> represents this option.</div>
<div>For example <code>config_data|ansible.utils.index_of(&#x27;x&#x27;</code>), in this case <code>config_data</code> represents this option.</div>
</td>
</tr>
<tr>
@ -93,8 +93,8 @@ Parameters
</td>
<td>
<div>When the data provided is a list of dictionaries, run the test against this dictionary key.</div>
<div>When using a <code>key</code>, the <code>data</code> must only contain dictionaries.</div>
<div>See <code>fail_on_missing</code> below to determine the behavior when the <code>key</code> is missing from a dictionary in the <code>data</code>.</div>
<div>When using a <em>key</em>, the <em>data</em> must only contain dictionaries.</div>
<div>See <em>fail_on_missing</em> below to determine the behavior when the <em>key</em> is missing from a dictionary in the <em>data</em>.</div>
</td>
</tr>
<tr>
@ -154,7 +154,7 @@ Parameters
<td>
</td>
<td>
<div>When only a single entry in the <code>data</code> is matched, the index of that entry is returned as an integer.</div>
<div>When only a single entry in the <em>data</em> is matched, the index of that entry is returned as an integer.</div>
<div>If set to <code>True</code>, the return value will always be a list, even if only a single entry is matched.</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@ Synopsis
--------
- This plugin returns the indices of items matching some criteria in a list.
- When working with a list of dictionaries, the key to evaluate can be specified.
- ``index_of`` is also available as a ``filter plugin`` for convenience.
- **index_of** is also available as a **filter plugin** for convenience.
- Using the parameters below- ``lookup('ansible.utils.index_of', data, test, value, key, fail_on_missing, wantlist``).
@ -90,7 +90,7 @@ Parameters
<td>
</td>
<td>
<div>When the data provided is a list of dictionaries, run the test against this dictionary key. When using a <code>key</code>, the <code>data</code> must only contain dictionaries. See <code>fail_on_missing</code> below to determine the behaviour when the <code>key</code> is missing from a dictionary in the <code>data</code>.</div>
<div>When the data provided is a list of dictionaries, run the test against this dictionary key. When using a <em>key</em>, the <em>data</em> must only contain dictionaries. See <em>fail_on_missing</em> below to determine the behaviour when the <em>key</em> is missing from a dictionary in the <em>data</em>.</div>
</td>
</tr>
<tr>
@ -125,7 +125,7 @@ Parameters
<td>
</td>
<td>
<div>The value used to test each list item against. Not required for simple tests (eg: <code>true</code>, <code>false</code>, <code>even</code>, <code>odd</code>) May be a <code>string</code>, <code>boolean</code>, <code>number</code>, <code>regular expression</code> <code>dict</code> and so on, depending on the <code>test</code> used.</div>
<div>The value used to test each list item against. Not required for simple tests (eg: <code>true</code>, <code>false</code>, <code>even</code>, <code>odd</code>) May be a <code>string</code>, <code>boolean</code>, <code>number</code>, <code>regular expression</code> <code>dict</code> and so on, depending on the <b>test</b> used.</div>
</td>
</tr>
<tr>
@ -146,7 +146,7 @@ Parameters
<td>
</td>
<td>
<div>When only a single entry in the <code>data</code> is matched, the index of that entry is returned as an integer. If set to <code>True</code>, the return value will always be a list, even if only a single entry is matched. This can also be accomplished using <code>query</code> or <code>q</code> instead of <code>lookup</code>. <a href='https://docs.ansible.com/ansible/latest/plugins/lookup.html'>https://docs.ansible.com/ansible/latest/plugins/lookup.html</a></div>
<div>When only a single entry in the <em>data</em> is matched, the index of that entry is returned as an integer. If set to <code>True</code>, the return value will always be a list, even if only a single entry is matched. This can also be accomplished using <code>query</code> or <code>q</code> instead of <code>lookup</code>. <a href='https://docs.ansible.com/ansible/latest/plugins/lookup.html'>https://docs.ansible.com/ansible/latest/plugins/lookup.html</a></div>
</td>
</tr>
</table>

View File

@ -1,90 +0,0 @@
.. _ansible.utils.jsonschema_validate:
************************
ansible.utils.jsonschema
************************
**Define configurable options for jsonschema validate plugin**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This plugin documentation provides the configurable options that can be passed to the validate plugins when *ansible.utils.json* is used as a value for engine option.
Parameters
----------
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th>Configuration</th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>draft</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>draft3</li>
<li>draft4</li>
<li>draft6</li>
<li><div style="color: blue"><b>draft7</b>&nbsp;&larr;</div></li>
</ul>
</td>
<td>
<div>env:ANSIBLE_VALIDATE_JSONSCHEMA_DRAFT</div>
<div>var: ansible_validate_jsonschema_draft</div>
</td>
<td>
<div>This option provides the jsonschema specification that should be used for the validating the data. The <code>criteria</code> option in the <code>validate</code> plugin should follow the specifiaction as mentined by this option</div>
</td>
</tr>
</table>
<br/>
Notes
-----
.. note::
- The value of ``data`` option should be either of type *dict* or *strings* which should be a valid *dict* when read in python.
- The value of ``criteria`` should be *list* of *dict* or *list* of *strings* and each *string* within the *list* entry should be a valid *dict* when read in python.
Status
------
Authors
~~~~~~~
- Ganesh Nalawade (@ganeshrn)
.. hint::
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.

View File

@ -20,7 +20,7 @@ Synopsis
- Flatten a complex object into a dictionary of paths and values.
- Paths are dot delimited whenever possible.
- Brackets are used for list indices and keys that contain special characters.
- ``to_paths`` is also available as a ``lookup plugin`` for convenience.
- **to_paths** is also available as a **lookup plugin** for convenience.
- Using the parameters below- ``var|ansible.utils.to_paths(prepend, wantlist``)
@ -52,7 +52,7 @@ Parameters
<td>
</td>
<td>
<div>Prepend each path entry. Useful to add the initial <code>var</code> name.</div>
<div>Prepend each path entry. Useful to add the initial <em>var</em> name.</div>
</td>
</tr>
<tr>
@ -70,9 +70,9 @@ Parameters
<td>
</td>
<td>
<div>The value of <code>var</code> will be will be used.</div>
<div>The value of <em>var</em> will be will be used.</div>
<div>This option represents the value that is passed to the filter plugin in pipe format.</div>
<div>For example <em>config_data|ansible.utils.to_paths(</em>), in this case <em>config_data</em> represents this option.</div>
<div>For example <code>config_data|ansible.utils.to_paths(</code>), in this case <code>config_data</code> represents this option.</div>
</td>
</tr>
<tr>

View File

@ -20,7 +20,7 @@ Synopsis
- Flatten a complex object into a dictionary of paths and values.
- Paths are dot delimited whenever possible.
- Brackets are used for list indices and keys that contain special characters.
- ``to_paths`` is also available as a filter plugin.
- **to_paths** is also available as a filter plugin.
- Using the parameters below- ``lookup('ansible.utils.to_paths', var, prepend, wantlist``)
@ -52,7 +52,7 @@ Parameters
<td>
</td>
<td>
<div>Prepend each path entry. Useful to add the initial <code>var</code> name.</div>
<div>Prepend each path entry. Useful to add the initial <em>var</em> name.</div>
</td>
</tr>
<tr>
@ -70,7 +70,7 @@ Parameters
<td>
</td>
<td>
<div>The value of <code>var</code> will be will be used.</div>
<div>The value of <em>var</em> will be used.</div>
</td>
</tr>
<tr>
@ -91,7 +91,7 @@ Parameters
<td>
</td>
<td>
<div>If set to <code>True</code>, the return value will always be a list. This can also be accomplished using <code>query</code> or <code>q</code> instead of <code>lookup</code>. <a href='https://docs.ansible.com/ansible/latest/plugins/lookup.html'>https://docs.ansible.com/ansible/latest/plugins/lookup.html</a></div>
<div>If set to <em>True</em>, the return value will always be a list. This can also be accomplished using <code>query</code> or <b>q</b> instead of <code>lookup</code>. <a href='https://docs.ansible.com/ansible/latest/plugins/lookup.html'>https://docs.ansible.com/ansible/latest/plugins/lookup.html</a></div>
</td>
</tr>
</table>

View File

@ -17,7 +17,7 @@ Version added: 1.0.0
Synopsis
--------
- Validate ``data`` with provided ``criteria`` based on the validation ``engine``.
- Validate *data* with provided *criteria* based on the validation *engine*.
@ -49,9 +49,9 @@ Parameters
<td>
</td>
<td>
<div>The criteria used for validation of value that represents <code>data</code> options.</div>
<div>This option represents the first argument passed in the filter plugin. For example <em>config_data|ansible.utils.validate(config_criteria</em>), in this case the value of <em>config_criteria</em> represents this option.</div>
<div>For the type of <code>criteria</code> that represents this value refer to the documentation of individual validator plugins.</div>
<div>The criteria used for validation of value that represents <em>data</em> options.</div>
<div>This option represents the first argument passed in the filter plugin. For example <code>config_data|ansible.utils.validate(config_criteria</code>), in this case the value of <code>config_criteria</code> represents this option.</div>
<div>For the type of <em>criteria</em> that represents this value refer to the documentation of individual validator plugins.</div>
</td>
</tr>
<tr>
@ -69,9 +69,9 @@ Parameters
<td>
</td>
<td>
<div>Data that will be validated against <code>criteria</code>.</div>
<div>This option represents the value that is passed to the filter plugin in pipe format. For example <em>config_data|ansible.utils.validate(</em>), in this case <em>config_data</em> represents this option.</div>
<div>For the type of <code>data</code> that represents this value refer to the documentation of individual validator plugins.</div>
<div>Data that will be validated against <em>criteria</em>.</div>
<div>This option represents the value that is passed to the filter plugin in pipe format. For example <code>config_data|ansible.utils.validate(</code>), in this case <code>config_data</code> represents this option.</div>
<div>For the type of <em>data</em> that represents this value refer to the documentation of individual validator plugins.</div>
</td>
</tr>
<tr>
@ -90,8 +90,8 @@ Parameters
</td>
<td>
<div>The name of the validator plugin to use.</div>
<div>This option can be passed in lookup plugin as a key, value pair. For example <em>config_data|ansible.utils.validate(config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</em>), in this case the value <em>ansible.utils.jsonschema</em> represents the engine to be use for data validation. If the value is not provided the default value that is <em>ansible.uitls.jsonschema</em> will be used.</div>
<div>The value should be in fully qualified collection name format that is <em>&lt;org-name&gt;.&lt;collection-name&gt;.&lt;validator-plugin-name&gt;</em>.</div>
<div>This option can be passed in lookup plugin as a key, value pair. For example <code>config_data|ansible.utils.validate(config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</code>), in this case the value <code>ansible.utils.jsonschema</code> represents the engine to be use for data validation. If the value is not provided the default value that is <code>ansible.uitls.jsonschema</code> will be used.</div>
<div>The value should be in fully qualified collection name format that is <code>&lt;org-name&gt;.&lt;collection-name&gt;.&lt;validator-plugin-name&gt;</code>.</div>
</td>
</tr>
</table>
@ -102,10 +102,10 @@ Notes
-----
.. note::
- For the type of options ``data`` and ``criteria`` refer to the individual ``validate`` plugin documentation that is represented in the value of ``engine`` option.
- For additional plugin configuration options refer to the individual ``validate`` plugin documentation that is represented by the value of ``engine`` option.
- The plugin configuration option can be either passed as *key=value* pairs within filter plugin or environment variables.
- The precedence of the ``validate`` plugin configurable option is the variable passed within filter plugin as *key=value* pairs followed by the environment variables.
- For the type of options *data* and *criteria* refer to the individual validate plugin documentation that is represented in the value of *engine* option.
- For additional plugin configuration options refer to the individual validate plugin documentation that is represented by the value of *engine* option.
- The plugin configuration option can be either passed as ``key=value`` pairs within filter plugin or environment variables.
- The precedence of the *validate* plugin configurable option is the variable passed within filter plugin as ``key=value`` pairs followed by the environment variables.

View File

@ -17,7 +17,7 @@ Version added: 1.0.0
Synopsis
--------
- Validate ``data`` with provided ``criteria`` based on the validation ``engine``.
- Validate *data* with provided *criteria* based on the validation *engine*.
@ -49,9 +49,9 @@ Parameters
<td>
</td>
<td>
<div>The criteria used for validation of value that represents <code>data</code> options.</div>
<div>This option represents the second argument passed in the lookup plugin For example <em>lookup(config_data, config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</em>), in this case the value of <em>config_criteria</em> represents this option.</div>
<div>For the type of <code>criteria</code> that represents this value refer to the documentation of individual validate plugins.</div>
<div>The criteria used for validation of value that represents <em>data</em> options.</div>
<div>This option represents the second argument passed in the lookup plugin For example <code>lookup(config_data, config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</code>), in this case the value of <code>config_criteria</code> represents this option.</div>
<div>For the type of <em>criteria</em> that represents this value refer to the documentation of individual validate plugins.</div>
</td>
</tr>
<tr>
@ -69,9 +69,9 @@ Parameters
<td>
</td>
<td>
<div>Data that will be validated against <code>criteria</code>.</div>
<div>This option represents the value that is passed to the lookup plugin as the first argument. For example <em>lookup(config_data, config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</em>), in this case <em>config_data</em> represents this option.</div>
<div>For the type of <code>data</code> that represents this value refer to the documentation of individual validate plugins.</div>
<div>Data that will be validated against <em>criteria</em>.</div>
<div>This option represents the value that is passed to the lookup plugin as the first argument. For example <code>lookup(config_data, config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</code>), in this case <code>config_data</code> represents this option.</div>
<div>For the type of <em>data</em> that represents this value refer to the documentation of individual validate plugins.</div>
</td>
</tr>
<tr>
@ -90,8 +90,8 @@ Parameters
</td>
<td>
<div>The name of the validate plugin to use.</div>
<div>This option can be passed in lookup plugin as a key, value pair. For example <em>lookup(config_data, config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</em>), in this case the value <em>ansible.utils.jsonschema</em> represents the engine to be use for data validation. If the value is not provided the default value that is <em>ansible.uitls.jsonschema</em> will be used.</div>
<div>The value should be in fully qualified collection name format that is <em>&lt;org-name&gt;.&lt;collection-name&gt;.&lt;validate-plugin-name&gt;</em>.</div>
<div>This option can be passed in lookup plugin as a key, value pair. For example <code>lookup(config_data, config_criteria, engine=&#x27;ansible.utils.jsonschema&#x27;</code>), in this case the value <code>ansible.utils.jsonschema</code> represents the engine to be use for data validation. If the value is not provided the default value that is <code>ansible.uitls.jsonschema</code> will be used.</div>
<div>The value should be in fully qualified collection name format that is <code>&lt;org-name&gt;.&lt;collection-name&gt;.&lt;validate-plugin-name&gt;</code>.</div>
</td>
</tr>
</table>
@ -102,10 +102,10 @@ Notes
-----
.. note::
- For the type of options ``data`` and ``criteria`` refer to the individual ``validate`` plugin documentation that is represented in the value of ``engine`` option.
- For additional plugin configuration options refer to the individual ``validate`` plugin documentation that is represented by the value of ``engine`` option.
- The plugin configuration option can be either passed as *key=value* pairs within lookup plugin or task or environment variables.
- The precedence the ``validate`` plugin configurable option is the variable passed within lookup plugin as *key=value* pairs followed by task variables followed by environment variables.
- For the type of options *data* and *criteria* refer to the individual validate plugin documentation that is represented in the value of *engine* option.
- For additional plugin configuration options refer to the individual validate plugin documentation that is represented by the value of *engine* option.
- The plugin configuration option can be either passed as ``key=value`` pairs within lookup plugin or task or environment variables.
- The precedence the validate plugin configurable option is the variable passed within lookup plugin as ``key=value`` pairs followed by task variables followed by environment variables.
@ -115,7 +115,7 @@ Examples
.. code-block:: yaml
- name: set facts for data and criteria
ansible.builtinset_fact:
ansible.builtin.set_fact:
data: "{{ lookup('ansible.builtin.file', './validate/data/show_interfaces_iosxr.json')}}"
criteria: "{{ lookup('ansible.builtin.file', './validate/criteria/jsonschema/show_interfaces_iosxr.json')}}"

View File

@ -46,7 +46,7 @@ Parameters
<td>
</td>
<td>
<div>The criteria used for validation of <code>data</code>. For the type of criteria refer to the documentation of individual validate plugins.</div>
<div>The criteria used for validation of <em>data</em>. For the type of criteria refer to the documentation of individual validate plugins.</div>
</td>
</tr>
<tr>
@ -62,7 +62,7 @@ Parameters
<td>
</td>
<td>
<div>Data that will be validated against <code>criteria</code>. For the type of data refer to the documentation of individual validate plugins.</div>
<div>Data that will be validated against <em>criteria</em>. For the type of data refer to the documentation of individual validate plugins.</div>
</td>
</tr>
<tr>
@ -89,10 +89,10 @@ Notes
-----
.. note::
- For the type of options ``data`` and ``criteria`` refer to the individual ``validate`` plugin documentation that is represented in the value of ``engine`` option.
- For additional plugin configuration options refer to the individual ``validate`` plugin documentation that is represented by the value of ``engine`` option.
- For the type of options *data* and *criteria* refer to the individual validate plugin documentation that is represented in the value of *engine* option.
- For additional plugin configuration options refer to the individual validate plugin documentation that is represented by the value of *engine* option.
- The plugin configuration option can be either passed as task or environment variables.
- The precedence of the ``validate`` plugin configurable option is task variables followed by the environment variables.
- The precedence of the validate plugin configurable option is task variables followed by the environment variables.
@ -135,11 +135,12 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>when <code>data</code> value is invalid</td>
<td>when <em>data</em> value is invalid</td>
<td>
<div>The list of errors in <code>data</code> based on the <code>criteria</code>.</div>
<div>The list of errors in <em>data</em> based on the <em>criteria</em>.</div>
<br/>
</td>
</tr>
@ -154,9 +155,9 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
</td>
<td>always</td>
<td>
<div>The msg indicates if the <code>data</code> is valid as per the <code>criteria</code>.</div>
<div>In case data is valid return success message <em>all checks passed</em>.</div>
<div>In case data is invalid return error message <em>Validation errors were found</em> along with more information on error is available.</div>
<div>The msg indicates if the <em>data</em> is valid as per the <em>criteria</em>.</div>
<div>In case data is valid return success message <b>all checks passed</b>.</div>
<div>In case data is invalid return error message <b>Validation errors were found</b> along with more information on error is available.</div>
<br/>
</td>
</tr>

View File

@ -17,7 +17,7 @@ Version added: 1.0.0
Synopsis
--------
- Validate ``data`` with provided ``criteria`` based on the validation ``engine``.
- Validate *data* with provided *criteria* based on the validation *engine*.
@ -49,9 +49,9 @@ Parameters
<td>
</td>
<td>
<div>The criteria used for validation of value that represents <code>data</code> options.</div>
<div>This option is passed to the test plugin as key, value pair For example <em>config_data is ansible.utils.validate(criteria=criteria</em>), in this case the value of <em>criteria</em> key represents this criteria for data validation.</div>
<div>For the type of <code>criteria</code> that represents this value refer documentation of individual validate plugins.</div>
<div>The criteria used for validation of value that represents <em>data</em> options.</div>
<div>This option is passed to the test plugin as key, value pair For example <code>config_data is ansible.utils.validate(criteria=criteria</code>), in this case the value of <em>criteria</em> key represents this criteria for data validation.</div>
<div>For the type of <em>criteria</em> that represents this value refer documentation of individual validate plugins.</div>
</td>
</tr>
<tr>
@ -69,9 +69,9 @@ Parameters
<td>
</td>
<td>
<div>A data that will be validated against <code>criteria</code>.</div>
<div>This option represents the value that is passed to test plugin as check. For example <em>config_data is ansible.utils.validate(criteria=criteria</em>, in this case <em>config_data</em> represents this option.</div>
<div>For the type of <code>data</code> that represents this value refer documentation of individual validate plugins.</div>
<div>A data that will be validated against <em>criteria</em>.</div>
<div>This option represents the value that is passed to test plugin as check. For example <code>config_data is ansible.utils.validate(criteria=criteria</code>, in this case <b>config_data</b> represents this option.</div>
<div>For the type of <em>data</em> that represents this value refer documentation of individual validate plugins.</div>
</td>
</tr>
<tr>
@ -90,8 +90,8 @@ Parameters
</td>
<td>
<div>The name of the validate plugin to use.</div>
<div>This option can be passed in test plugin as a key, value pair For example <em>config_data is ansible.utils.validate(engine=&#x27;ansible.utils.jsonschema&#x27;, criteria=criteria</em>), in this case the value of <em>engine</em> key represents the engine to be use for data validation. If the value is not provided the default value that is <em>ansible.uitls.jsonschema</em> will be used.</div>
<div>The value should be in fully qualified collection name format that is <em>&lt;org-name&gt;.&lt;collection-name&gt;.&lt;validate-plugin-name&gt;</em>.</div>
<div>This option can be passed in test plugin as a key, value pair For example <code>config_data is ansible.utils.validate(engine=&#x27;ansible.utils.jsonschema&#x27;, criteria=criteria</code>), in this case the value of <em>engine</em> key represents the engine to be use for data validation. If the value is not provided the default value that is <code>ansible.utils.jsonschema</code> will be used.</div>
<div>The value should be in fully qualified collection name format that is <b>&lt;org-name&gt;.&lt;collection-name&gt;.&lt;validate-plugin-name&gt;</b>.</div>
</td>
</tr>
</table>
@ -102,10 +102,10 @@ Notes
-----
.. note::
- For the type of options ``data`` and ``criteria`` refer the individual ``validate`` plugin documentation that is represented in the value of ``engine`` option.
- For additional plugin configuration options refer the individual ``validate`` plugin documentation that is represented by the value of ``engine`` option.
- The plugin configuration option can be either passed as *key=value* pairs within test plugin or set as environment variables.
- The precedence the ``validate`` plugin configurable option is the variable passed within test plugin as *key=value* pairs followed by task variables followed by environment variables.
- For the type of options *data* and *criteria* refer the individual validate plugin documentation that is represented in the value of *engine* option.
- For additional plugin configuration options refer the individual validate plugin documentation that is represented by the value of *engine* option.
- The plugin configuration option can be either passed as ``key=value`` pairs within test plugin or set as environment variables.
- The precedence the validate plugin configurable option is the variable passed within test plugin as ``key=value`` pairs followed by task variables followed by environment variables.