- name: "Test case for https://github.com/ansible/ansible/issues/32384"
  hosts: all
  gather_facts: no
  vars:
    ignore_assertion_errors: false
  tasks:
    - name: Test using a variable with ignore_errors that evaluates to false
      assert:
        that: item < 2
        msg: "{{ item }} isn't < 2"
      ignore_errors: "{{ ignore_assertion_errors }}"
      with_items:
        - 1
        - 2

    - name: Fail if the previous task doesn't end the play
      fail:
        msg: Previous task was expected to fail
