Passing condition to "failed_when" as a variable

I try to pass a condition to failed_when as a variable:

my_commands:

@Openuser87 welcome to the Ansible Forum!
If you could copy in more of your playbook that would help.

Welcome to the Ansible Forum, let’s continue the discussion in