summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/provider/zone/solaris.rb3
-rw-r--r--lib/puppet/type/zone.rb27
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb
index c11444993..a1df041cb 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 408d6f5dd..fc524a541 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."