Documentation

    PLEASE NOTE: This document applies to latest version and not to the latest stable release v2.16

    Documentation for other releases can be found by using the version selector in the left bottom of any doc page.

    block

    This module allows grouping tasks together for execution. Similar to Ansible’s block directive.

    Note: vars declared in a block are added to the parent context.

    Attributes

    check_mode:
      support: full
    

    Parameters

    Parameter Required Type Values Description
    block true list   List of tasks to execute

    Example

    - name: Example block
      block:
        - name: Create a file
          copy:
            content: "Hello World"
            dest: "/tmp/test.txt"
    
        - name: Run a command
          command:
            cmd: "echo 'Success'"