Skip to content

Commit

Permalink
Add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrews committed Nov 17, 2021
1 parent 1070c4c commit 289e6eb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ansible_runner/interface.py
Expand Up @@ -903,6 +903,8 @@ def get_role_list(collection=None, playbook_dir=None, **kwargs):
'''
Run an ``ansible-doc`` command to get list of installed collection roles.
.. note:: Version added: 2.2
:param str collection: A fully qualified collection name used to filter the results.
:param str playbook_dir: This parameter is used to sets the relative path to handle playbook adjacent installed roles.
Expand Down Expand Up @@ -973,7 +975,9 @@ def get_role_list(collection=None, playbook_dir=None, **kwargs):

def get_role_argspec(role, collection=None, **kwargs):
'''
Run an ``ansible-doc`` command to get a collection role argument spec.
Run an ``ansible-doc`` command to get a collection role argument specification.
.. note:: Version added: 2.2
'''
event_callback_handler = kwargs.pop('event_handler', None)
status_callback_handler = kwargs.pop('status_handler', None)
Expand Down
27 changes: 27 additions & 0 deletions docs/python_interface.rst
Expand Up @@ -99,6 +99,33 @@ and it can be customized to return only the changed configuration value by setti
view of the active configuration file. The exectuin will be in the foreground and return a tuple of output and error response when finished.
While running the command within the container the current local working diretory will be volume mounted within the container.

``get_role_list()`` helper function
-----------------------------------

:meth:`ansible_runner.interface.get_role_list`

*Version added: 2.2*

This function will execute the ``ansible-doc`` command to return the list of installed roles.
This data can be fetched from either the local environment or from within a container image
based on the parameters passed. It will run in the foreground and return a tuple of output
and error response when finished. Successful output will be in JSON format as returned from
``ansible-doc``.

``get_role_argspec()`` helper function
--------------------------------------

:meth:`ansible_runner.interface.get_role_argspec`

*Version added: 2.2*

This function will execute the ``ansible-doc`` command to return a role argument specification.
This data can be fetched from either the local environment or from within a container image
based on the parameters passed. It will run in the foreground and return a tuple of output
and error response when finished. Successful output will be in JSON format as returned from
``ansible-doc``.


The ``Runner`` object
---------------------

Expand Down

0 comments on commit 289e6eb

Please sign in to comment.