How to compare kernel (or other) version numbers in Ansible
There is a test for it: {{ ansible_distribution_version is version(‘12.04’, ‘>=’) }} {{ sample_version_var is version(‘1.0’, operator=”lt”, strict=True) }}
There is a test for it: {{ ansible_distribution_version is version(‘12.04’, ‘>=’) }} {{ sample_version_var is version(‘1.0’, operator=”lt”, strict=True) }}
They both seem to be the same. Take a look here: # the magic variable mapping dictionary below is used to translate # host/inventory variables to fields in the PlayContext # object. The dictionary values are tuples, to account for aliases # in variable names. MAGIC_VARIABLE_MAPPING = dict( connection = (‘ansible_connection’,), remote_addr = (‘ansible_ssh_host’, ‘ansible_host’), … Read more