A zone dataset is just a zfs filesystem in the global zone.  This zfs 
filesystem needs to exist before it can be given to a zone as a dataset.  It 
seemed to make sense to autorequire the zfs filesystem.  This patch just 
autorequires the zfs filesystem which will be the dataset and let's the zfs 
type manage autorequiring the parent zfs filesystems and zpool.

Signed-off-by: Derek Olsen <[email protected]>
---
 lib/puppet/type/zone.rb |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index d523c46..5398bc3 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -386,6 +386,21 @@ Puppet::Type.newtype(:zone) do
     end
   end
 
+  # If Puppet is also managing the zfs filesystem which is the zone dataset
+  # then list it as a prerequisite.  Zpool's get autorequired by the zfs
+  # type.  We just need to autorequire the dataset zfs itself as the zfs type
+  # will autorequire all of the zfs parents and zpool.
+  autorequire(:zfs) do
+
+    reqs = []
+
+    self[:dataset].each { |value|
+      reqs << value
+    }
+
+    reqs
+  end
+
   def validate_ip(ip, name)
       IPAddr.new(ip) if ip
   rescue ArgumentError
-- 
1.7.3.2

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to