From 863fde62b6fd3d8333742ce3697c5c45ed4a4791 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 9 Aug 2022 16:00:29 +0530 Subject: [PATCH] Update for artifacts_handler * Added a new example for artifacts_handler Fixes: #739 Signed-off-by: Abhijeet Kasurde --- docs/python_interface.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/python_interface.rst b/docs/python_interface.rst index 5564d6a03..87c48db7c 100644 --- a/docs/python_interface.rst +++ b/docs/python_interface.rst @@ -218,6 +218,18 @@ Usage examples print(r.stats) +.. code-block:: python + + import ansible_runner + + def my_artifacts_handler(artifacts_dir): + # Do something here + print(artifacts_dir) + + # Do something with artifact directory after the run is complete + r = ansible_runner.run(private_data_dir='/tmp/demo', playbook='test.yml', artifacts_handler=my_artifacts_handler) + + .. code-block:: python import ansible_runner