Metadata-Version: 2.5
Name: trytond_ansible
Version: 8.0.0
Summary: Ansible Base Module
Author: Clemens Hupka
Maintainer-email: Clemens Hupka <clemens.hupka@backend.at>
License-Expression: GPL-3.0-or-later
License-File: COPYRIGHT
License-File: LICENSE
Keywords: ansible,automation,configuration,tryton
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Plugins
Classifier: Framework :: Tryton
Classifier: Topic :: Office/Business
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.10
Requires-Dist: trytond<8.1,>=8.0
Provides-Extra: test
Description-Content-Type: text/x-rst

Ansible
=======

The ``ansible`` module provides the base infrastructure for the Ansible
module suite.  It defines number-sequence management, a singleton
configuration model, and a runner abstraction for executing
``ansible-playbook`` as a subprocess.

Features
--------

- **Sequence Management**: Map short codes (e.g. ``job``) to
  ``ir.sequence`` records so sub-modules can look up number sequences
  programmatically via ``ansible.sequence.get_sequence('job')``.
- **Configuration Singleton**: A module-wide configuration model
  (``ansible.config``) holding the default job sequence, runner
  settings (playbook path, inventory, roles path, forks, timeout, host
  key checking), and extensible by sub-modules.
- **Runner Integration**: An abstract ``ansible.runner`` model that
  builds ``ansible-playbook`` commands, manages subprocess lifecycle
  (PID tracking, timeout, SIGTERM cancellation), injects environment
  variables, and parses structured results with callback plugin
  events.

Configuration
-------------

After installing the module, navigate to *Ansible > Configuration >
Config* to set:

- The default job sequence.
- The ansible-playbook executable path (if not on ``PATH``).
- The default inventory file.
- The roles path (``ANSIBLE_ROLES_PATH``).
- The default number of forks.
- The default timeout in seconds.
- Whether SSH host key checking is enabled.

Sequences can be managed under *Ansible > Configuration > Sequences*.

Dependencies
------------

- Tryton modules: ``ir``, ``res``.

Models
------

- ``ansible.sequence`` — ``Sequence``: maps a code to an
  ``ir.sequence`` for programmatic look-up.
- ``ansible.config`` — ``Configuration``: a singleton with the default
  job sequence reference and runner settings.
- ``ansible.runner`` — ``Runner``: abstract model providing
  ``ansible-playbook`` subprocess execution, command building,
  environment injection, timeout/cancel handling, and result parsing.

Callback Plugin
---------------

A custom Ansible callback plugin (``callback_plugin.py``) is shipped
with the module.  It emits JSON events (one per line) to a file
descriptor specified by ``ANSIBLE_RUNNER_CALLBACK_FD``, enabling
real-time event capture during playbook execution.

Cron Jobs
---------

None.

Wizards
-------

None.
