W3cubDocs

/Ansible 2.11

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 module utilities included in ansible.module_utils.basic and AnsibleModule are documented under Reference & Appendices.

Attributes

AnsibleModule.params

The parameters accepted by the module.

ansible.module_utils.basic.ANSIBLE_VERSION
ansible.module_utils.basic.SELINUX_SPECIAL_FS

Deprecated in favor of ansibleModule._selinux_special_fs.

AnsibleModule.ansible_version
AnsibleModule._debug
AnsibleModule._diff
AnsibleModule.no_log
AnsibleModule._selinux_special_fs

(formerly ansible.module_utils.basic.SELINUX_SPECIAL_FS)

AnsibleModule._syslog_facility
self.playbook
self.play
self.task
sys.path

Classes

``ansible.module_utils.basic.AnsibleModule``

The basic utilities for AnsibleModule.

class AnsibleModule

The main class for an Ansible module.

Functions

ansible.module_utils.basic._load_params()

Load parameters.

Methods

AnsibleModule.log()

Logs the output of Ansible.

AnsibleModule.debug()

Debugs Ansible.

Ansible.get_bin_path()

Retrieves the path for executables.

AnsibleModule.run_command()

Runs a command within an Ansible module.

module.fail_json()

Exits and returns a failure.

module.exit_json()

Exits and returns output.

Modules

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/api/index.html