From 9dac19520044aba11ff5dea166ed693c4b2f3635 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 6 Dec 2016 15:02:49 +0100 Subject: [PATCH] take-over: use more precise ceph.conf detection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Prior to this patch we were just looking for any *.conf file which sometimes could results in multiple matches. The new command looks for a .conf file that must contain [global] and 'fsid' patterns. This will definitely get us the ceph.conf file. We can not directly use ceph.conf because of a different cluster name. Signed-off-by: Sébastien Han --- infrastructure-playbooks/take-over-existing-cluster.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infrastructure-playbooks/take-over-existing-cluster.yml b/infrastructure-playbooks/take-over-existing-cluster.yml index 8347c1bef..08b31bd59 100644 --- a/infrastructure-playbooks/take-over-existing-cluster.yml +++ b/infrastructure-playbooks/take-over-existing-cluster.yml @@ -27,7 +27,8 @@ - include_vars: group_vars/all.yml - name: get the name of the existing ceph cluster - shell: "ls /etc/ceph/*.conf" + shell: | + grep -lE '\[global\]|fsid' /etc/ceph/*.conf changed_when: false register: ceph_conf -- 2.47.3