Fail for unsupported ansible version

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/438/head
Sébastien Han 2015-11-20 15:17:24 +01:00
parent 50eb69e3be
commit 83b2a51fe1
1 changed files with 11 additions and 0 deletions

View File

@ -20,3 +20,14 @@
when: when:
ceph_stable_rh_storage and ceph_stable_rh_storage and
{{ ansible_distribution_version | version_compare('7.1', '<') }} {{ 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
sudo: 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', '<') }}"