There is a test for it:
{{ ansible_distribution_version is version('12.04', '>=') }}
{{ sample_version_var is version('1.0', operator="lt", strict=True) }}
Related Contents:
- Ansible remote_user vs ansible_user
- How to use Ansible’s with_item with a variable?
- How can I use Ansible nested variable?
- How to copy files between two nodes using ansible
- Using set_facts and with_items together in Ansible
- Specify sudo password for Ansible
- Using Ansible set_fact to create a dictionary from register results
- Why does Ansible show “ERROR! no action detected in task” error?
- Only check whether a line present in a file (ansible)
- How do I register a variable and persist it between plays targeted on different nodes?
- Whats the difference between ansible ‘raw’, ‘shell’ and ‘command’?
- How can a user with SSH keys authentication have sudo powers in Ansible? [duplicate]
- Ansible fails with /bin/sh: 1: /usr/bin/python: not found
- In Ansible, how to combine variables from separate files into one array?
- How to switch a user per task or set of tasks?
- Not possible to source .bashrc with Ansible
- Ansible: How to iterate over a role with an array?
- How can I copy files between two managed nodes using Ansible?
- Ansible: filter a list by its attributes
- Register variables in with_items loop in Ansible playbook
- What is the Git equivalent for revision number?
- How to set Linux environment variables with Ansible
- How do I set register a variable to persist between plays in ansible?
- Ansible Command module says that ‘|’ is illegal character
- Running ansible-playbook using Python API
- How to do multiline shell script in Ansible
- How to move/rename a file using an Ansible task on a remote system
- Ansible shell module returns error when grep results are empty