From 3ce0621b449d57307c1885505cfcd17c94e026d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Sun, 21 Feb 2016 18:25:42 +0100 Subject: [PATCH] ceph-osd: use fact logic to set permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- roles/ceph-mds/tasks/pre_requisite.yml | 1 - roles/ceph-osd/tasks/pre_requisite.yml | 44 ++++++-------------------- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/roles/ceph-mds/tasks/pre_requisite.yml b/roles/ceph-mds/tasks/pre_requisite.yml index 78bc44641..ef05bfd69 100644 --- a/roles/ceph-mds/tasks/pre_requisite.yml +++ b/roles/ceph-mds/tasks/pre_requisite.yml @@ -38,7 +38,6 @@ group: "{{ key_group }}" when: cephx - - name: activate metadata server with upstart file: path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/{{ item }} diff --git a/roles/ceph-osd/tasks/pre_requisite.yml b/roles/ceph-osd/tasks/pre_requisite.yml index 4f1a5f15e..cd0fd7424 100644 --- a/roles/ceph-osd/tasks/pre_requisite.yml +++ b/roles/ceph-osd/tasks/pre_requisite.yml @@ -11,46 +11,22 @@ state: present when: ansible_os_family == 'RedHat' -- name: create bootstrap-osd directory (for or after infernalis release) +- name: create bootstrap-osd directory file: path: /var/lib/ceph/bootstrap-osd/ state: directory - owner: ceph - group: ceph - mode: 0755 + owner: "{{ dir_owner }}" + group: "{{ dir_group }}" + mode: "{{ dir_mode }}" when: - cephx and - is_ceph_infernalis + cephx -- name: create bootstrap-osd directory (before infernalis release) - file: - path: /var/lib/ceph/bootstrap-osd/ - state: directory - owner: root - group: root - mode: 0755 - when: - cephx and - not is_ceph_infernalis - -- name: copy osd bootstrap key (for or after infernalis release) +- name: copy osd bootstrap key copy: src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring" dest: /var/lib/ceph/bootstrap-osd/ceph.keyring - owner: ceph - group: ceph - mode: 0600 + owner: "{{ key_owner }}" + group: "{{ key_group }}" + mode: "{{ key_mode }}" when: - cephx and - is_ceph_infernalis - -- name: copy osd bootstrap key (before infernalis release) - copy: - src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring" - dest: /var/lib/ceph/bootstrap-osd/ceph.keyring - owner: root - group: root - mode: 600 - when: - cephx and - not is_ceph_infernalis + cephx