# a way to stop ansible execution with a plugin/forced variable validations

**URL:** <https://forum.ansible.com/t/a-way-to-stop-ansible-execution-with-a-plugin-forced-variable-validations/30327>\
**Category:** AWX Project\
**Created:** [May 14, 2019, 1:09pm UTC](https://forum.ansible.com/t/a-way-to-stop-ansible-execution-with-a-plugin-forced-variable-validations/30327 "2019-05-14T13:09:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saulius\_alisauskas](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@saulius\_alisauskas](https://forum.ansible.com/u/saulius_alisauskas)\
**Post date:** [May 14, 2019, 1:09pm UTC](https://forum.ansible.com/t/a-way-to-stop-ansible-execution-with-a-plugin-forced-variable-validations/30327/1 "2019-05-14T13:09:46Z")

</div>

hi,  
I am looking for a way to stop Ansible execution if it doesn’t meet certain conditions through a plugin. A more concrete example: i want to check that tasks has certain variables defined and if they don’t - fail.

I first looked at callback plugins but they are not allowed to fail. task\_queue\_manager:send\_callback has a comment: “# TODO: add config toggle to make this fatal or not?” and it simply catches any exceptions thrown by callback methods.

Is there any other way that one to get a hook into ansible execution lifecycle, do some inspection on variables and fail it if needed ?

Appreciate any help with this.
