Skip to main content

ansible_python

ansible_python module

Execute Python-based Ansible modules. This is a bridge module that allows running traditional Ansible modules written in Python within the Spage environment.

Examples

- name: Run Python module
ansible_python:
module_name: "setup"
args:
gather_subset: "all"

- name: Execute custom Python module
ansible_python:
module_name: "my_custom_module"
args:
parameter1: "value1"
parameter2: 42

Note: This module requires Python and the specified Ansible module to be available on the target system. It's primarily used for compatibility with existing Ansible modules that haven't been ported to native Go implementations.

Module Capabilities

  • Has Revert: false
  • Provides Variables: None

Inputs

ParameterTypeDescriptionRequiredDefaultChoices
argsanyArguments to pass to the Python module. Can be a dictionary or other data structure depending on the module requirements.false
module_namestringName of the Python Ansible module to execute.false

Outputs

FieldTypeDescription
changedbool
failedbool
msgstring
resultsmap[string]any