2018-09-07 15:57:36 +02:00
|
|
|
.. _ansible.module_utils:
|
|
|
|
.. _module_utils:
|
|
|
|
|
|
|
|
***************************************************************
|
|
|
|
Ansible Reference: Module Utilities
|
|
|
|
***************************************************************
|
|
|
|
|
2018-12-10 16:17:15 +01:00
|
|
|
This page documents utilities intended to be helpful when writing
|
|
|
|
Ansible modules in Python.
|
2018-09-07 15:57:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
AnsibleModule
|
|
|
|
--------------
|
|
|
|
|
2018-12-10 16:17:15 +01:00
|
|
|
To use this functionality, include ``from ansible.module_utils.basic import AnsibleModule`` in your module.
|
2018-09-07 15:57:36 +02:00
|
|
|
|
2018-12-10 16:17:15 +01:00
|
|
|
.. autoclass:: ansible.module_utils.basic.AnsibleModule
|
|
|
|
:members:
|
2020-03-25 19:13:56 +01:00
|
|
|
:noindex:
|
2018-09-07 15:57:36 +02:00
|
|
|
|
|
|
|
Basic
|
|
|
|
------
|
|
|
|
|
2018-12-10 16:17:15 +01:00
|
|
|
To use this functionality, include ``import ansible.module_utils.basic`` in your module.
|
2018-09-07 15:57:36 +02:00
|
|
|
|
2018-12-10 16:17:15 +01:00
|
|
|
.. automodule:: ansible.module_utils.basic
|
|
|
|
:members:
|
2021-04-20 21:40:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
Argument Spec
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
Classes and functions for validating parameters against an argument spec.
|
|
|
|
|
|
|
|
ArgumentSpecValidator
|
|
|
|
=====================
|
|
|
|
|
|
|
|
.. autoclass:: ansible.module_utils.common.arg_spec.ArgumentSpecValidator
|
|
|
|
:members:
|
|
|
|
|
|
|
|
ValidationResult
|
|
|
|
================
|
|
|
|
|
|
|
|
.. autoclass:: ansible.module_utils.common.arg_spec.ValidationResult
|
|
|
|
:members:
|
|
|
|
:member-order: bysource
|
|
|
|
:private-members: _no_log_values # This only works in sphinx >= 3.2. Otherwise it shows all private members with doc strings.
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
==========
|
|
|
|
|
|
|
|
.. automodule:: ansible.module_utils.common.parameters
|
|
|
|
:members:
|
|
|
|
|
|
|
|
.. py:data:: DEFAULT_TYPE_VALIDATORS
|
|
|
|
|
|
|
|
:class:`dict` of type names, such as ``'str'``, and the default function
|
|
|
|
used to check that type, :func:`~ansible.module_utils.common.validation.check_type_str` in this case.
|
|
|
|
|
|
|
|
Validation
|
|
|
|
==========
|
|
|
|
|
|
|
|
Standalone functions for validating various parameter types.
|
|
|
|
|
|
|
|
.. automodule:: ansible.module_utils.common.validation
|
|
|
|
:members:
|
|
|
|
|
|
|
|
|
|
|
|
Errors
|
|
|
|
------
|
|
|
|
|
|
|
|
.. automodule:: ansible.module_utils.errors
|
|
|
|
:members:
|
|
|
|
:member-order: bysource
|