Tests — Ansible Documentation
docs.ansible.com › ansible › 2Dec 01, 2020 · To compare a version number, such as checking if the ansible_distribution_versionversion is greater than or equal to ‘12.04’, you can use the version_comparefilter. The version_comparefilter can also be used to evaluate the ansible_distribution_version: {{ansible_distribution_version|version_compare('12.04','>=')}}
Ansible: Compare Version Numbers - Examples - ShellHacks
www.shellhacks.com › ansible-compare-versionNov 16, 2021 · The variables in Ansible can be compared using the version test as follows: # roles/compare_versions/vars/main.yml--- current_version: "1.58.2" latest_version: "1.60.2" update_is_required: "{{ current_version is version(latest_version, ' ') }}" The update_is_required in the example above will be set to True or False depending on a versions comparison result. The version test accepts the following operators:
Tests — Ansible Documentation
docs.ansible.com › ansible › latestDec 21, 2021 · To compare a version number, such as checking if the ansible_facts['distribution_version'] version is greater than or equal to ‘12.04’, you can use the version test. The version test can also be used to evaluate the ansible_facts['distribution_version']