- name: Task that fails due to templating error for plugin option
  debug: msg="{{ 5 / 0 | int }}"
  ignore_errors: true
  register: result

- assert:
    that:
      - result.failed
      - result.exception

- name: Loop that fails due to templating error in first entry and ignores errors
  debug: msg="{{ 5 / item }}"
  ignore_errors: true
  register: result
  loop: [0, 0, 1]

- debug: var=result

- assert:
    that:
      - result.results[0].failed
      - result.results[0].exception
      - result.results[0].item == 0

      - result.results[1].failed
      - result.results[1].exception
      - result.results[1].item == 0

      - not result.results[2].failed
      - result.results[2].exception is undefined
      - result.results[2].item == 1
