From 6e8d487f3d81d4e37838c927fed425c3ae08adac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Thu, 17 Oct 2013 23:28:27 -0400 Subject: [PATCH] Better mounted check The previous check would fail to properly detect if things weren't mounted, especially if the NFS server and the mount point shared a common name (e.g. /home or something). --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 4e5e7f5..d51250e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -60,13 +60,13 @@ ensure_resource('file', $dirtree, {'ensure' => 'directory'}) exec { "/bin/mount '${dest}'": - unless => "/bin/mount -l | /bin/grep '${dest}'", + unless => "/bin/mount -l | /bin/grep ' on ${dest} type '", require => [File[$dirtree], Fstab["fstab entry for ${source} to ${dest} as ${type}"]], } } 'absent': { exec { "/bin/umount '${dest}'": - onlyif => "/bin/mount -l | /bin/grep '${dest}'", + onlyif => "/bin/mount -l | /bin/grep ' on ${dest} type '", before => Fstab["fstab entry for ${source} to ${dest} as ${type}"], }