Use version test instead of version_compare

This test was changed to 'version' in ansible 2.5 [1].

[1] https://docs.ansible.com/ansible/2.8/user_guide/playbooks_tests.html#version-comparison

Change-Id: If6a4a14fe5bdda27a2d8e050fcac71337ea05d02
This commit is contained in:
Dmitriy Rabotyagov 2019-09-10 13:43:16 +03:00
parent b6d45cf35b
commit 7bde578d9b

View File

@ -38,10 +38,10 @@
{{ _virtualenv_version.stdout }} is installed.
when:
- ((_virtualenv_version.stdout | trim) == 'none') or
((_virtualenv_version.stdout | trim) is version_compare('1.10', '<'))
((_virtualenv_version.stdout | trim) is version('1.10', '<'))
- name: Set extra virtualenv parameters
set_fact:
_venv_create_extra_options: >-
{{ ((_virtualenv_version.stdout | trim) is version_compare('14.0.0', '<')) | ternary('--never-download', '--no-download') }}
{{ ((_virtualenv_version.stdout | trim) is version_compare('1.7.0', '<')) | ternary('--no-site-packages', '') }}
{{ ((_virtualenv_version.stdout | trim) is version('14.0.0', '<')) | ternary('--never-download', '--no-download') }}
{{ ((_virtualenv_version.stdout | trim) is version('1.7.0', '<')) | ternary('--no-site-packages', '') }}