Use ansible_version when available for precheck

Use the ansible_version variable introduced in Ansible 1.8. It is a far
more accurate check.

TrivialFix

Change-Id: I1265ca3de583ff6f9335b8e5e8fe4ea4aadf565b
This commit is contained in:
Andrew Widdersheim 2016-09-14 16:33:08 -04:00
parent 37ec5ecb52
commit e775958354

View File

@ -7,7 +7,6 @@
result.stdout | version_compare(docker_py_version_min, '<') result.stdout | version_compare(docker_py_version_min, '<')
- name: Checking Ansible version - name: Checking Ansible version
local_action: command ansible --version local_action: fail msg="Current Ansible version {{ ansible_version.full }} is less than {{ ansible_version_min }}"
register: result run_once: true
changed_when: false when: ansible_version.full | version_compare(ansible_version_min, '<')
failed_when: result.stdout | regex_replace('ansible (\\d+\\.\\d+\\.\\d+)', '\\1') | version_compare(ansible_version_min, '<')