# \[WARNING\]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: result.stdout.find("{{rhel\_version}}") != -1

**URL:** <https://forum.ansible.com/t/warning-conditional-statements-should-not-include-jinja2-templating-delimiters-such-as-or-found-result-stdout-find-rhel-version-1/31028>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [August 13, 2019, 7:18am UTC](https://forum.ansible.com/t/warning-conditional-statements-should-not-include-jinja2-templating-delimiters-such-as-or-found-result-stdout-find-rhel-version-1/31028 "2019-08-13T07:18:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nishant\_Srivastava](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@Nishant\_Srivastava](https://forum.ansible.com/u/Nishant_Srivastava)\
**Post date:** [August 13, 2019, 7:18am UTC](https://forum.ansible.com/t/warning-conditional-statements-should-not-include-jinja2-templating-delimiters-such-as-or-found-result-stdout-find-rhel-version-1/31028/1 "2019-08-13T07:18:50Z")

</div>

##### SUMMARY

We are using the conditional check in our Ansible code where we are waiting for change to take effect before comparing in next block. Code reference below:

```auto
- name: Set RHEL version to "{{rhel_version}}"
  shell: |
    subscription-manager release --set="{{rhel_version}}"
  register: release
  changed_when: "release.rc == -1"
  failed_when: "release.rc >= 1"
  when: "('confluent.package_name[:-6]') not in ansible_facts.packages"

- name: Waiting until RHEL version changes to "{{rhel_version}}"
  shell: |
    subscription-manager release
  register: result
  until: result.stdout.find("{{rhel_version}}") != -1
  retries: 60
  delay: 5
  when: "('confluent.package_name[:-6]') not in ansible_facts.packages"

```

> until: result.stdout.find(“{{rhel\_version}}”) != -1 is giving the warning. So i tried changing it to  
> `until: result.stdout.find"(‘rhel\_version’)" != -1´ but it gave another error.  
> The error was: template error while templating string: expected token ‘end of statement block’, got ‘string’. String: {% if result.stdout.find “(‘rhel\_version’)” != -1 %} True {% else %} False {% endif %}"}

##### ISSUE TYPE- Bug Report

##### COMPONENT NAME

It is related to warning when we use jinja2 delimiters in conditional statement. But I am referencing a variable declared in global\_vars file so i have no other option to reference it. I tried few combinations but didn’t work with syntax.  
Now i am looking some help to convert ``until: result.stdout.find(“{{rhel\_version}}”) != -1´´ this conditional string with another way to reference (“{{rhel\_version}}”)

##### ANSIBLE VERSION

ansible 2.8.1  
config file = /home/corp.eden/e974797adm/ikep-infrastructure/ansible/ansible.cfg  
configured module search path = [u’/home/corp.eden/e974797adm/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.5 (default, Jun 11 2019, 12:19:05) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [August 13, 2019, 10:14am UTC](https://forum.ansible.com/t/warning-conditional-statements-should-not-include-jinja2-templating-delimiters-such-as-or-found-result-stdout-find-rhel-version-1/31028/2 "2019-08-13T10:14:28Z")

</div>

You don’t need the jinja blocks if you don’t quote the value, I.e.

until: result.stdout.find(rhel\_version) != -1
