assert - Fail with custom message

Author:Michael DeHaan

Synopsis

New in version 1.5.

This module asserts that a given expression is true and can be a simpler alternative to the ‘fail’ module in some cases.

Options

parameter required default choices comments
that yes
    A string expression of the same form that can be passed to the 'when' statementAlternatively, a list of string expressions

    Examples


    - assert: { that: "ansible_os_family != 'RedHat'" }
    
    - assert:
        that:
          - "'foo' in some_command_result.stdout"
          - "number_of_the_counting == 3"

    Table Of Contents

    Previous topic

    accelerate - Enable accelerated mode on remote node

    Next topic

    debug - Print statements during execution