summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/api/index.rst
blob: 27afbe42cc32d3781d2794791b98a47d89b5db2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
:orphan:

*************************
Ansible API Documentation
*************************

The Ansible API is under construction. These stub references for attributes, classes, functions, methods, and modules will be documented in future.
The :ref:`module utilities <ansible.module_utils>` included in ``ansible.module_utils.basic`` and ``AnsibleModule`` are documented under Reference & Appendices.

.. contents::
   :local:

Attributes
==========

.. py:attribute:: AnsibleModule.params

The parameters accepted by the module.

.. py:attribute:: ansible.module_utils.basic.ANSIBLE_VERSION

.. py:attribute:: ansible.module_utils.basic.SELINUX_SPECIAL_FS

Deprecated in favor of ansibleModule._selinux_special_fs.

.. py:attribute:: AnsibleModule.ansible_version

.. py:attribute:: AnsibleModule._debug

.. py:attribute:: AnsibleModule._diff

.. py:attribute:: AnsibleModule.no_log

.. py:attribute:: AnsibleModule._selinux_special_fs

(formerly ansible.module_utils.basic.SELINUX_SPECIAL_FS)

.. py:attribute:: AnsibleModule._syslog_facility

.. py:attribute:: self.playbook

.. py:attribute:: self.play

.. py:attribute:: self.task

.. py:attribute:: sys.path


Classes
=======

.. py:class:: ``ansible.module_utils.basic.AnsibleModule``
   :noindex:

The basic utilities for AnsibleModule.

.. py:class:: AnsibleModule

The main class for an Ansible module.


Functions
=========

.. py:function:: ansible.module_utils.basic._load_params()

Load parameters.


Methods
=======

.. py:method:: AnsibleModule.log()

Logs the output of Ansible.

.. py:method:: AnsibleModule.debug()

Debugs Ansible.

.. py:method:: Ansible.get_bin_path()

Retrieves the path for executables.

.. py:method:: AnsibleModule.run_command()

Runs a command within an Ansible module.

.. py:method:: module.fail_json()

Exits and returns a failure.

.. py:method:: module.exit_json()

Exits and returns output.


Modules
=======

.. py:module:: ansible.module_utils

.. py:module:: ansible.module_utils.basic
  :noindex:


.. py:module:: ansible.module_utils.url