From: Kefu Chai Date: Fri, 9 Dec 2016 18:36:52 +0000 (+0800) Subject: tasks/ceph: restore context of osd mount path before mkfs X-Git-Tag: v11.1.1~58^2^2~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=53225d5272a1d35d4183fcfa55a139f55f77e122;p=ceph.git tasks/ceph: restore context of osd mount path before mkfs all newly created files and directories under the mount dir inherit the SELinux type of their parent directory. so we need to set it before mkfs. Fixes: http://tracker.ceph.com/issues/16800 Signed-off-by: Kefu Chai --- diff --git a/tasks/ceph.py b/tasks/ceph.py index e05ab9b94c9..1a3cbe2ce00 100644 --- a/tasks/ceph.py +++ b/tasks/ceph.py @@ -752,6 +752,12 @@ def cluster(ctx, config): mnt_point, ] ) + remote.run( + args=[ + 'sudo', '/sbin/restorecon', mnt_point, + ], + check_status=False, + ) if not remote in ctx.disk_config.remote_to_roles_to_dev_mount_options: ctx.disk_config.remote_to_roles_to_dev_mount_options[remote] = {} ctx.disk_config.remote_to_roles_to_dev_mount_options[remote][role] = mount_options