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/20220815214408.72b4f848%40rovaniemi.

Reply via email to