Fix the wrong selinux context when glance uses nfs backend
authorPierre Blanc <pblanc@redhat.com>
Thu, 5 Nov 2015 19:36:18 +0000 (14:36 -0500)
committerPierre Blanc <pblanc@redhat.com>
Mon, 9 Nov 2015 19:32:07 +0000 (14:32 -0500)
We updated the pacemaker resource configuration
of fs-varlibglanceimages-clone to mount nfs directory
with a specified context.

Details on : https://bugzilla.redhat.com/show_bug.cgi?id=1237150

Change-Id: Ia0dd471858f470ae3e82d25151ebe65b8cdbec4f

puppet/manifests/overcloud_controller_pacemaker.pp

index adb5218..5cadc6d 100644 (file)
@@ -526,11 +526,12 @@ if hiera('step') >= 3 {
   $glance_store = concat($http_store, $backend_store)
 
   if $glance_backend == 'file' and hiera('glance_file_pcmk_manage', false) {
+    $secontext = 'context="system_u:object_r:glance_var_lib_t:s0"'
     pacemaker::resource::filesystem { 'glance-fs':
       device       => hiera('glance_file_pcmk_device'),
       directory    => hiera('glance_file_pcmk_directory'),
       fstype       => hiera('glance_file_pcmk_fstype'),
-      fsoptions    => hiera('glance_file_pcmk_options', ''),
+      fsoptions    => join([$secontext, hiera('glance_file_pcmk_options', '')],','),
       clone_params => '',
     }
   }