From 4c9e24a90fca2271978a066e38dfadead88d8167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Fri, 10 Aug 2018 11:08:14 +0200 Subject: [PATCH] mon: fix calamari initialisation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If calamari is already installed and ceph has been upgraded to a higher version the initialisation will fail later. So if we detect the calamari-server is too old compare to ceph_rhcs_version we try to update it. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1601755 Signed-off-by: Sébastien Han --- roles/ceph-mon/tasks/calamari.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/roles/ceph-mon/tasks/calamari.yml b/roles/ceph-mon/tasks/calamari.yml index 4e2e9e667..bf42f2aa3 100644 --- a/roles/ceph-mon/tasks/calamari.yml +++ b/roles/ceph-mon/tasks/calamari.yml @@ -1,8 +1,17 @@ --- +- name: test if calamari-server is installed + command: rpm -q --qf "%{VERSION}\n" calamari-server + args: + warn: no + ignore_errors: true + check_mode: no + changed_when: false + register: calamari_server_rpm_state + - name: install calamari server package: name: calamari-server - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" + state: "{{ 'latest' if (calamari_server_rpm_state.stdout.split('.')[0] is version(ceph_rhcs_version, '<') and not calamari_server_rpm_state.failed) else (upgrade_ceph_packages|bool) | ternary('latest','present') }}" tags: - package-install