I want to abort execution of remaining task if certain condition is failed. and display proper error message.
So instead of skipping remaining task I want to show er
You can use
It will go along with something like this
#check if params are invalid then abort below all tasks.
- name: 'check parm is null or invalid'
fail: msg="Please enter correct Params"
when: "param1 is not defined or param2 is not defined " ## whatever condition you want