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

Best,
Catie

On Monday, 12 June 2017 12:29:35 UTC-4, Kai Stian Olstad wrote:
>
> On 10. juni 2017 04:39, 晓婷 Catie 徐 wrote: 
> > 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? 
>
> 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 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e7661d98-eece-491e-8106-e093aedf8997%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to