# How to use when condition with value in range

**URL:** <https://forum.ansible.com/t/how-to-use-when-condition-with-value-in-range/26141>\
**Category:** Ansible Project\
**Created:** [November 27, 2017, 12:23pm UTC](https://forum.ansible.com/t/how-to-use-when-condition-with-value-in-range/26141 "2017-11-27T12:23:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sushil\_kumar](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@sushil\_kumar](https://forum.ansible.com/u/sushil_kumar)\
**Post date:** [November 27, 2017, 12:23pm UTC](https://forum.ansible.com/t/how-to-use-when-condition-with-value-in-range/26141/1 "2017-11-27T12:23:55Z")

</div>

Hi Team,

I have a requirement to use replace module of ansible when a specific variable value is in some range like below  
Release (2.1) and ABOVE  
Release 2.0.3 → 2.0.99  
Release 1.8.8 → 1.8.99  
Release 1.7.11 → 1.7.99  
something like – When: version | int == [1.7.11 … 1.7.99] , any help will be much appreciative.

---

<div class="post-metadata">

**Author:** ![rhysmeister](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rhysmeister/32/10599_2.png) [@rhysmeister](https://forum.ansible.com/u/rhysmeister)\
**Post date:** [November 27, 2017, 12:39pm UTC](https://forum.ansible.com/t/how-to-use-when-condition-with-value-in-range/26141/2 "2017-11-27T12:39:25Z")

</div>

[http://docs.ansible.com/ansible/latest/playbooks\_tests.html#version-comparison](http://docs.ansible.com/ansible/latest/playbooks_tests.html#version-comparison)
