From ee1e4707575b838b7d2ed34279dbbe1f29307cd0 Mon Sep 17 00:00:00 2001 From: James Saint-Rossy Date: Tue, 12 Apr 2016 21:08:42 -0400 Subject: [PATCH] moved string parsing of ceph version into ansbile for better error handling --- roles/ceph-common/tasks/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index 02d333920..8048bddb9 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -65,15 +65,18 @@ - package-install - name: get ceph version - shell: ceph --version | cut -f3 -d ' ' + command: ceph --version changed_when: false register: ceph_version +- set_fact: + ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}" + # 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={{ ceph_version.stdout | version_compare('9.2.0', '>=') }} + is_ceph_infernalis={{ ceph_version | version_compare('9.2.0', '>=') }} - set_fact: dir_owner: ceph -- 2.39.5