Hi Racke,
Can you please help me to form the logic as you suggested above for below
condition
when: "{% for item in hostvars.values() %}{% if item.MyDoneVar|default(False)
%}True{% endif %}{% endfor %}"
On Monday, August 9, 2021 at 7:48:58 PM UTC+5:30 [email protected] wrote:
> On 09/08/2021 15:10, Mahesh Nalavade wrote:
> > Hi ,
> >
> > While running the ansible task in azure pipeline we are getting the
> below warning message. Please let us know if we can ignore/suppress the
> warning.
> >
> > [WARNING]: conditional statements should not include jinja2 templating
> > delimiters such as {{ }} or {% %}. Found: {% for item in
> hostvars.values() %}{%
> > if item.MyDoneVar|default(False) %}True{% endif %}{% endfor %}
>
> The logic behind your condition eludes me, but the expression for
> conditions are always subject to templating. This means you can't use {{,
> {% if, {% for etc.
>
> You can start to convert your logic to
>
> hostvar.values | dict2items | ... | count
>
> Regards
> Racke
>
> >
> > ==========================================================
> > Playbook:-
> > =============
> > ---
> > - name: Check the status of DSE layer 7 cluster
> > hosts: XXXX
> > gather_facts: False
> > serial: 1
> > tasks:
> > - meta: end_play
> >
> when: "{% for item in hostvars.values() %}{% if
> item.MyDoneVar|default(False) %}True{% endif %}{% endfor %}"
> > - name: nodetool status playbook execution
> > import_role:
> > name: ../roles/dse/nodetool_status_check
> >
> > Role:-
> > =========
> > ---
> > - name: Nodetool status for DSE layer 7 cluster
> > block:
> > - name: Nodetool Status
> >
> shell: nodetool -u controlRole -pw '{{ controlRole_dse_layer7_pass }}'
> status | grep -A 10 {{ dse_layer_7_datacenter_name }}
> > register: result_nodetool
> > - set_fact:
> > MyDoneVar: True
> >
> > --
> > 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] <mailto:
> [email protected]>.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c7db9905-75f3-452e-88a3-3ca2b95b3836n%40googlegroups.com
>
> <
> https://groups.google.com/d/msgid/ansible-project/c7db9905-75f3-452e-88a3-3ca2b95b3836n%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration.
>
>
--
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/4cc66db4-d8a2-4aa7-b4e3-e7833122347bn%40googlegroups.com.