when statements should not include jinja2 templating delimiters

Hi,

I ran into this warning with different scenario:

For example,I have a registered variable “command_result” from previous command result. Also, I have a variable “num”, which is a number. I want to use when statement to compare if the value of command_result.stdout equals num in string. For example, command_result.stdout is “1”, and num is 1. How can I write the when statement?

Thank you in advance,
Catie

If you have showed us the when statement you are using today it would be easier to understand what you are trying to do.
But I think you are looking for something like this.

   when: command_result.stdout == num | string

or

   when: command_result.stdout | int == num

Thank you, Kai. I think converting types what I am looking for.

Best,
Catie