# ansible 2.0.2 check if a variable contain a specific value

**URL:** <https://forum.ansible.com/t/ansible-2-0-2-check-if-a-variable-contain-a-specific-value/21101>\
**Category:** Ansible Project\
**Created:** [April 8, 2016, 7:49am UTC](https://forum.ansible.com/t/ansible-2-0-2-check-if-a-variable-contain-a-specific-value/21101 "2016-04-08T07:49:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imed\_khaskhoussi](https://avatars.discourse-cdn.com/v4/letter/i/919ad9/32.png) [@imed\_khaskhoussi](https://forum.ansible.com/u/imed_khaskhoussi)\
**Post date:** [April 8, 2016, 7:49am UTC](https://forum.ansible.com/t/ansible-2-0-2-check-if-a-variable-contain-a-specific-value/21101/1 "2016-04-08T07:49:10Z")

</div>

i want to check if `{{variable1}}` contain a specific word for example i want to check if this variable contain the word “SNAPSHOT” or “RELEASE”. is there a command can do that ?

thank you in advance .

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 8, 2016, 4:42pm UTC](https://forum.ansible.com/t/ansible-2-0-2-check-if-a-variable-contain-a-specific-value/21101/2 "2016-04-08T16:42:18Z")

</div>

when: “‘SNAPSHOT’ in variable1 or ‘RELEASE’ in variable1”
