From e7aae2780165c4db8b294f35ceb90af1f2b0b162 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Mon, 16 May 2016 18:37:28 +0200 Subject: [PATCH] ceph-common: fix ceph options default path again MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit closes: #788 Signed-off-by: Sébastien Han --- roles/ceph-common/tasks/main.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index 6cc13dee3..8bb88db06 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -231,10 +231,30 @@ line: "CLUSTER={{ cluster }}" when: ansible_os_family == "RedHat" +- name: check /etc/default/ceph exist + stat: + path: /etc/default/ceph + register: etc_default_ceph + when: ansible_os_family == "Debian" + - name: configure cluster name lineinfile: dest: /etc/default/ceph insertafter: EOF create: yes line: "CLUSTER={{ cluster }}" - when: ansible_os_family == "Debian" + when: + - ansible_os_family == "Debian" + - etc_default_ceph.stat.exists + - not etc_default_ceph.stat.isdir + +- name: configure cluster name + lineinfile: + dest: /etc/default/ceph/ceph + insertafter: EOF + create: yes + line: "CLUSTER={{ cluster }}" + when: + - ansible_os_family == "Debian" + - etc_default_ceph.stat.exists + - etc_default_ceph.stat.isdir -- 2.47.3