diff --git a/docs/docsite/rst/playbooks_blocks.rst b/docs/docsite/rst/playbooks_blocks.rst index 5d2f668d470ca4..1799b4e1ea1a2a 100644 --- a/docs/docsite/rst/playbooks_blocks.rst +++ b/docs/docsite/rst/playbooks_blocks.rst @@ -80,6 +80,24 @@ Another example is how to run handlers after an error occurred : - name: run me even after an error debug: msg='this handler runs even on error' + +Conditional Execution +````````````````````` + +Blocks allow groups of tasks to be skipped based on a conditional test. + +.. code-block:: YAML + :caption: Block conditional execution example + + tasks: + - block: + - debug: var=msg + when: true + when: true + + +Any and all of the tasks in the ``block`` would only be executed if the condition being tested was true. + .. seealso:: :doc:`playbooks`