From: Sébastien Han Date: Tue, 6 Dec 2016 14:02:49 +0000 (+0100) Subject: take-over: use more precise ceph.conf detection X-Git-Tag: v2.1.0~28^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1155%2Fhead;p=ceph-ansible.git take-over: use more precise ceph.conf detection 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 --- 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