Not sure how that would work.  This should work

when: "'Linked to: ' ~ agent_host not in nessus_link_status.stdout"

Another way to do this is to define a local var

vars:
  __str: "Linked to: {{ agent_host }}"  # not sure if the quotes are
strictly necessary - I default to using quotes when the string contains ":"
when: __str not in nessus_link_status.stdout


On Fri, Mar 3, 2023 at 2:22 PM <[email protected]> wrote:

> when: "'Linked to: agent_host' not in nessus_link_status.stdout"
>
>
>
> The above works for me.
>
>
>
> *From:* 'Hearn, Stan J.' via Ansible Project <
> [email protected]>
> *Sent:* Friday, March 3, 2023 4:15 PM
> *To:* [email protected]
> *Subject:* [ansible-project] conditional statements should not include
> jinja2 templating delimiters
>
>
>
> I have this when clause that contains a variable named agent_host and I
> can't determine how to rewrite it to remove the mustaches.  The logic
> works, however I get the warning.
>
>
>
>     when: "'Linked to: {{ agent_host }}' not in nessus_link_status.stdout"
>
>
>
> [WARNING]: conditional statements should not include jinja2 templating
> delimiters such as {{ }} or {% %}. Found: 'Linked to: {{ agent_host }}' not
> in nessus_link_status.stdout
>
>
>
> Thanks,
>
> Stan
>
>
>
> --
> 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/PH0PR10MB559317CE2B6196CA9289334CF0B39%40PH0PR10MB5593.namprd10.prod.outlook.com
> <https://groups.google.com/d/msgid/ansible-project/PH0PR10MB559317CE2B6196CA9289334CF0B39%40PH0PR10MB5593.namprd10.prod.outlook.com?utm_medium=email&utm_source=footer>
> .
>
> --
> 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/044e01d94e16%2446054da0%24d20fe8e0%24%40gmail.com
> <https://groups.google.com/d/msgid/ansible-project/044e01d94e16%2446054da0%24d20fe8e0%24%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CALF5A-Luzqvq7eQhDkgHT%3DXy6Y6%3DRAbhuPu7%3DoRPBatxA7BKMA%40mail.gmail.com.

Reply via email to