[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:06:09 UTC 2011


The following commit has been merged in the experimental branch:
commit 0a2a58c8650e8956a4ae464d364310ced244303b
Author: Derek Olsen <derek.olsen at e-hps.com>
Date:   Thu Jan 13 14:07:00 2011 -0800

    (#5479) Autorequire zfs filesystem when zone dataset is configured
    
     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.
    
    Reviewed-By: Daniel Pittman <daniel at puppetlabs.com>
    Reviewed-By: Matt Robinson <matt at puppetlabs.com>

diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index fc524a5..c7c2aa1 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -413,6 +413,23 @@ 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
+
+  # Check if we have datasets in our zone configuration
+    if @parameters.include? :dataset
+      reqs = []
+      # Autorequire each dataset
+      self[:dataset].each { |value|
+        reqs << value
+      }
+      reqs
+    end
+  end
+
   def validate_ip(ip, name)
       IPAddr.new(ip) if ip
   rescue ArgumentError

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list