I'm expecting set_facts not to assign values to variables when the SQL query does not yeild any results.
when condition command_result.stdout == "" is meant for the same.
Below is my playbook.
Hello Mohtashim,
you need to use "when" instead of "failed_when" in order to skip the set_fact task.
Regards
Racke