From db8eff9e4ec06506c4d6d5b820160addcbe42560 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 15 Nov 2023 03:03:48 +0900 Subject: [PATCH] Fix ignored notifications/orders This fixes the resource notifications and orders defined in the mount class was unintentionally ignored unless selinux is enabled. Also, resource collectors are replaced by explicit resources, because we can expect precise list of resources defined in the class. Finally, restorecon should be executed when the directory is mounted, regardless of the result of chmod. Change-Id: If919c7aceb5394a99657c3be7dc4f376d8a1b453 --- manifests/storage/mount.pp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/manifests/storage/mount.pp b/manifests/storage/mount.pp index adf3cb74..967ccd2d 100644 --- a/manifests/storage/mount.pp +++ b/manifests/storage/mount.pp @@ -84,6 +84,14 @@ define swift::storage::mount( before => Anchor['swift::config::end'], } + File["${mnt_base_dir}/${name}"] + -> Exec["fix_mountpoint_permissions_${name}"] + -> Mount["${mnt_base_dir}/${name}"] + -> Exec["mount_${name}"] + + Mount["${mnt_base_dir}/${name}"] ~> Exec["fix_mount_permissions_${name}"] + Exec["mount_${name}"] ~> Exec["fix_mount_permissions_${name}"] + # mounting in linux and puppet is broken and non-atomic # we have to mount, check mount with executing command, # fix ownership and on selinux systems fix context. @@ -99,15 +107,7 @@ define swift::storage::mount( refreshonly => true, } - File<| title == "${mnt_base_dir}/${name}" |> - ~> Exec<| title == "fix_mountpoint_permissions_${name}" |> - -> Exec<| title == "mount_${name}" |> - - File<| title == "${mnt_base_dir}/${name}" |> - ~> Mount<| title == "${mnt_base_dir}/${name}" |> - ~> Exec<| title == "mount_${name}" |> - ~> Exec<| title == "fix_mount_permissions_${name}" |> - ~> Exec<| title == "restorecon_mount_${name}" |> - + Mount["${mnt_base_dir}/${name}"] ~> Exec["restorecon_mount_${name}"] + Exec["mount_${name}"] ~> Exec["restorecon_mount_${name}"] } }