diff --git a/docs/python_interface.rst b/docs/python_interface.rst index 87c48db7c..01a856999 100644 --- a/docs/python_interface.rst +++ b/docs/python_interface.rst @@ -262,6 +262,21 @@ Usage examples print("Final status:") print(r.stats) +.. code-block:: python + + from ansible_runner import Runner, RunnerConfig + + # Using tag using RunnerConfig + rc = RunnerConfig( + private_data_dir="project", + playbook="main.yml", + tags='my_tag', + ) + + rc.prepare() + r = Runner(config=rc) + r.run() + .. code-block:: python # run the role named 'myrole' contained in the '/project/roles' directory