Validate the deployment from role level

Hi,

I want to validate two inventories files if they contain matching string and continue with the deployment based on the validation result.

I don’t want to have a pre-task at the deployment level. I want the validation should happen from the role level.

Thanks
Bijay