Rather than
when: RUNNING in job_check.stdout_lines
the canonical forms are either
when: job_check.stdout_lines is search("RUNNING")
or
when: job_check.stdout is search("RUNNING")
On Friday, August 12, 2022 at 2:01:26 AM UTC-4 farrukha...@gmail.com wrote:
> Hello Team,
>
> Hope
That's not true, I do it all the time. The raw yaml value needs to be
quoted but you still need to quote the inner string value to make sure it's
interpreted as a string, e.g.
when: '"RUNNING" in job_check.stdout_lines'
On Tuesday, August 16, 2022 at 6:20:02 AM UTC+10 walte...@nist.gov wrote:
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
U
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
Ansi
You do not need double quote. A 'when' condition does not need to be quoted.
That said a 'when' condition also does not do an effective "grep" to see if
one string is contained in a list of strings. It will do exact matches only.
This will work.
+++
---
- name: testing when
hosts: localhost
Hi,
> Don't you need to put "RUNNING" in quotes? It is a string, no?
>
> when: "RUNNING" in job_check.stdout_lines
actually you need double quotes, since YAML would complain about the
quotes not being terminated correctly:
> when: '"RUNNING" in job_check.stdout_lines'
Alternatively you co
Don't you need to put "RUNNING" in quotes? It is a string, no?
when: "RUNNING" in job_check.stdout_lines
--
Walter Rowe, Chief
Infrastructure Services
Office of Information Systems Management
National Institute of Standards and Technology
United States Department of Commerce
On Friday, August