ansible / proposals

Repository for sharing and tracking progress on enhancement proposals for Ansible.
Creative Commons Zero v1.0 Universal
93 stars 19 forks source link

Python API Documentation #20

Open dekimsey opened 8 years ago

dekimsey commented 8 years ago

Proposal: Python API Documentation

Author: Daniel Kimsey

Date: 2016/06/21

Ansible has great user-oriented documentation detailing how the public facing components of the ansible tool works. But it is seriously lacking in internal documentation. The Python API page doesn't go into sufficient detail about all the various innards.

This makes writing plugins a bit challenging. Extending/hacking the internals is nigh-impossible. A great deal of work was done in v2 to OO the internals, but actual Sphinx/readthedocs style documentation of what various internals do and why is severely lacking.

Problems

For noteworthy places include:

This is unfortunately something that might take a lot of work simply because there is very little existing API documentation. I fear the community will be less able to contribute than core-developers because it requires intimate knowledge of what these classes are and how they function.

abadger commented 8 years ago

See the connection plugin for an example of what we could be doing in this space: https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/__init__.py

trondhindenes commented 7 years ago

I couldn't agree more, I was planning to use the api's when I wrote flansible (https://github.com/trondhindenes/flansible) but I simply couldn't figure it out, so I ended up building a shell-based thing instead. Would be great to have the api's at a level where it's at least feasible to build custom automation on top if ansible without having to shell the execution.

bcoca commented 3 years ago

@trondhindenes that is what ansible-runner is for

labeled 'in progress' as runner is a documented usable API and the 'public APIs' in ansilbe (module_utils/*, etc) have started the process of being documented https://docs.ansible.com/ansible/latest/reference_appendices/module_utils.html