Validate variables all at once

Has anyone ever written a script/playbook that will validate all of the variables in a template are defined in the vars.yml file without having to fail each time a missing one is found? I’d like to figure out a way to know that my template variables are all defined in my dictionary of variables in a single execution. In other words, “give me a list of variables in my template that aren’t found in my dictionary.”

Thanks in advance!

Adam