From 2d1cec643d3076164aff1ede6a5d93af89d09e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 11 Feb 2016 17:34:44 +0100 Subject: [PATCH] use the ansible_version variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use the builtin variable to check the ansible version Signed-off-by: Sébastien Han --- roles/ceph-common/tasks/checks/check_system.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/roles/ceph-common/tasks/checks/check_system.yml b/roles/ceph-common/tasks/checks/check_system.yml index a823fdc40..e0c93da8b 100644 --- a/roles/ceph-common/tasks/checks/check_system.yml +++ b/roles/ceph-common/tasks/checks/check_system.yml @@ -21,13 +21,9 @@ ceph_stable_rh_storage and {{ ansible_distribution_version | version_compare('7.1', '<') }} -- name: check ansible version - local_action: shell ansible --version | awk '/[0-9].[0-9].[0-9]/ {print $2}' - changed_when: false - become: false - register: ansible__version - - name: fail on unsupported ansible version fail: msg: "Ansible version must be >= 1.9, please update!" - when: "{{ ansible__version.stdout | version_compare('1.9', '<') }}" + when: + ansible_version.major|int == 1 and + ansible_version.minor|int < 9