Am Mittwoch, 24. Mai 2017 17:03:20 UTC+2 schrieb Rich Lees:
>
> Hi All,
>
> Am new to this group and Google Groups in general so please go easy.
>
> I have a few questions about the recent change in Ansible 2.3.0.0 that new 
> prints a warning when jinja2 templating is included in a when, changed_when 
> and failed_when statement. Please see this closed GitHub issue for more 
> details on exactly what warning I mean: 
> https://github.com/ansible/ansible/issues/22397
>

Hi All,

I found this discussion in the githup issue mentined above. In my case I 
need to run a play only when a certain string was found an the output of 
another command. Example main.yml from one of my roles:
---
  - name: Install Red Hat Security Advisory (RHSA)
    command: yum -y update-minimal --advisory {{ rhsa_to_install }}
    register: yum_output
  - debug: var=yum_output

  - name: Reboot Host if any packages were updated
    shell: sleep 2 && shutdown -r now "Ansible updates triggered"
    async: 1
    poll: 0
    ignore_errors: true
    when: ("Complete!" in "{{ yum_output.stdout_lines[-1] }}") or
          ("Komplett!" in "{{ yum_output.stdout_lines[-1] }}")

 Since Ansible 2.3 I got the warnings described in detail in 
https://github.com/ansible/ansible/issues/22397.

I would like to get back the behaviour from Ansible <2.3. While I'm new to 
Ansible I may simply not know how to work around this warnings by declaring 
the when statement in a different way. Could someone give me a hand here?

Regards,
Joerg

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to