I agree, and placing it in quotes doesn't fix it. I tested your suggestion 
and it also failed. It doesn't like starting a 'when' clause with a quote 
in any form.
--
Walter Rowe, Chief
Infrastructure Services
Office of Information Systems Management
National Institute of Standards and Technology
United States Department of Commerce

On Monday, August 15, 2022 at 3:44:26 PM UTC-4 Felix Fontein wrote:

> Hi,
>
> > You do not need double quote. A 'when' condition does not need to be
> > quoted.
>
> this has nothing to do with 'when' conditions, but with YAML parsing.
>
> A statement such as
>
> > when: "RUNNING" in job_check.stdout_lines 
>
> will result in a YAML parsing error. Actually the error output from
> Ansible is pretty helpful here:
>
> > This one looks easy to fix. It seems that there is a value started
> > with a quote, and the YAML parser is expecting to see the line ended
> > with the same kind of quote. For instance:
> > 
> > when: "ok" in result.stdout
> > 
> > Could be written as:
> > 
> > when: '"ok" in result.stdout'
> > 
> > Or equivalently:
> > 
> > when: "'ok' in result.stdout"
>
> Cheers,
> Felix
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/694a2be8-efd7-41ac-9708-696cbf322420n%40googlegroups.com.

Reply via email to