From 23e40e3113abb9bc8690318dc7c806950a4a2fba Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 25 Mar 2016 08:51:20 -0500 Subject: [PATCH] Make RBD client directory owner/group configurable Some versions (?) of libvirt provide a 'libvirt' group instead of 'libvirtd'. (Observed with libvirt-daemon-1.2.17-13.el7_2.2.x86_64.) This makes the RBD client directory owner and group configurable to allow for this. --- group_vars/all.sample | 4 +++- roles/ceph-common/defaults/main.yml | 4 +++- roles/ceph-common/tasks/installs/install_on_redhat.yml | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/group_vars/all.sample b/group_vars/all.sample index 48375f711..4750bb2e0 100644 --- a/group_vars/all.sample +++ b/group_vars/all.sample @@ -181,7 +181,9 @@ dummy: #rbd_cache: "true" #rbd_cache_writethrough_until_flush: "true" #rbd_concurrent_management_ops: 20 -#rbd_client_directories: false # this will create rbd_client_log_path and rbd_client_admin_socket_path directories with proper permissions, this WON'T work if libvirt and kvm are installed +#rbd_client_directories: false # this will create rbd_client_log_path and rbd_client_admin_socket_path directories with proper permissions +#rbd_client_directory_user: qemu +#rbd_client_directory_group: libvirtd #rbd_client_log_file: /var/log/rbd-clients/qemu-guest-$pid.log # must be writable by QEMU and allowed by SELinux or AppArmor #rbd_client_log_path: /var/log/rbd-clients/ #rbd_client_admin_socket_path: /var/run/ceph/rbd-clients # must be writable by QEMU and allowed by SELinux or AppArmor diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 1a66d3c46..8348840f5 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -173,7 +173,9 @@ debug_mds_level: 20 rbd_cache: "true" rbd_cache_writethrough_until_flush: "true" rbd_concurrent_management_ops: 20 -rbd_client_directories: false # this will create rbd_client_log_path and rbd_client_admin_socket_path directories with proper permissions, this WON'T work if libvirt and kvm are installed +rbd_client_directories: false # this will create rbd_client_log_path and rbd_client_admin_socket_path directories with proper permissions +rbd_client_directory_user: qemu +rbd_client_directory_group: libvirtd rbd_client_log_file: /var/log/rbd-clients/qemu-guest-$pid.log # must be writable by QEMU and allowed by SELinux or AppArmor rbd_client_log_path: /var/log/rbd-clients/ rbd_client_admin_socket_path: /var/run/ceph/rbd-clients # must be writable by QEMU and allowed by SELinux or AppArmor diff --git a/roles/ceph-common/tasks/installs/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml index da0ce967e..5a346e75d 100644 --- a/roles/ceph-common/tasks/installs/install_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_on_redhat.yml @@ -148,8 +148,8 @@ file: path: "{{ item }}" state: directory - owner: qemu - group: libvirtd + owner: "{{ rbd_client_directory_user }}" + group: "{{ rbd_client_directory_group }}" mode: 0755 with_items: - rbd_client_log_path