From b55df730610a77dd88bbfef1b1e4e6a76c708eb8 Mon Sep 17 00:00:00 2001 From: James Saint-Rossy Date: Mon, 4 Apr 2016 18:19:49 -0400 Subject: [PATCH] Cleanup is_ceph_infernalis logic --- roles/ceph-common/tasks/main.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index f40a3bdb8..9d4887bf8 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -64,24 +64,16 @@ tags: - package-install -- name: get ceph rhcs version - shell: rpm -q --qf "%{version}\n" ceph-common | cut -f1,2 -d '.' +- name: get ceph version + shell: ceph --version | cut -f3 -d ' ' changed_when: false - failed_when: false - register: rh_storage_version - when: ceph_stable_rh_storage - -# NOTE (leseb): be careful with the following -# somehow the YAML syntax using "is_ceph_infernalis: {{" -# does NOT work, so we keep this syntax styling... -- set_fact: - is_ceph_infernalis={{ (ceph_stable and ceph_stable_release not in ceph_stable_releases) or (ceph_dev) or (ceph_stable_rh_storage and (rh_storage_version.stdout | version_compare('0.94', '>'))) }} + register: ceph_version +# NOTE (leseb/jsaintrocc): Your supposed to qoute variables +# that follow colons to avoid confusion with dicts but this +# causes issues with the boolean, so we keep this syntax styling... - set_fact: - is_ceph_infernalis=True - when: - ansible_os_family == 'Debian' and - ceph_stable_rh_storage + is_ceph_infernalis={{ ceph_version.stdout | version_compare('9.2.0', '>=') }} - set_fact: dir_owner: ceph -- 2.39.5