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

Jesse Wolfe jes5199 at gmail.com
Tue May 10 08:03:20 UTC 2011


The following commit has been merged in the experimental branch:
commit c88afa0cb9917177502700fddffcf8a40ca75f90
Author: Derek Olsen <derek.olsen at e-hps.com>
Date:   Fri Nov 26 13:57:10 2010 -0800

    (#5393) Add "dataset" parameter to the zone provider
    
    This patch extends the zone provider to support the inclusion of one or more datasets in a solaris zone.  A dataset is an zfs filesystem that has been delegated from the global zone to the non global zone.

diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb
index c114449..a1df041 100644
--- a/lib/puppet/provider/zone/solaris.rb
+++ b/lib/puppet/provider/zone/solaris.rb
@@ -221,6 +221,9 @@ Puppet::Type.type(:zone).provide(:solaris) do
     if dir = config["inherit-pkg-dir"]
       result[:inherit] = dir.collect { |dirs| dirs[:dir] }
     end
+    if datasets = config["dataset"]
+      result[:dataset] = datasets.collect { |dataset| dataset[:name] }
+    end
     result[:iptype] = config[:"ip-type"]
     if net = config["net"]
       result[:ip] = net.collect do |params|
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index 408d6f5..fc524a5 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -282,6 +282,33 @@ Puppet::Type.newtype(:zone) do
     end
   end
 
+  newproperty(:dataset, :parent => ZoneMultiConfigProperty) do
+    desc "The list of datasets delegated to the non global zone from the
+      global zone.  All datasets must be zfs filesystem names which is
+      different than the mountpoint." 
+
+    validate do |value|
+      unless value !~ /^\//
+        raise ArgumentError, "Datasets must be the name of a zfs filesystem"
+      end
+    end
+
+    # Add a zfs filesystem to our list of datasets.
+    def add(dataset)
+      "add dataset\nset name=#{dataset}\nend"
+    end
+
+    # Remove a zfs filesystem from our list of datasets.
+    def rm(dataset)
+      "remove dataset name=#{dataset}"
+    end
+
+    def should
+      @should
+    end
+  end
+
+
   newproperty(:inherit, :parent => ZoneMultiConfigProperty) do
     desc "The list of directories that the zone inherits from the global
       zone.  All directories must be fully qualified."

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list