--- - hosts: localhost remote_user: root pre_tasks: - package: # Install additional dependecies name: bind-utils state: latest roles: - role: standard-test-rpm tags: - classic tasks: - include_tasks: test_basic_zone.yml - set_fact: tests_passed: '{{ test_basic_zone_failed is undefined }}' - name: report results debug: msg: | test_basic_zone: {{ 'FAILED' if test_basic_zone_failed is defined else 'OK'}} - name: fail playbook if tests failed debug: msg: --- {{ 'PASSED' if tests_passed else 'FAILED' }} --- failed_when: not tests_passed