From 3eff2254e69cf66b6e9f94631900fba26172c850 Mon Sep 17 00:00:00 2001 From: Andrew Shafer Date: Mon, 1 Dec 2008 02:58:09 -0700 Subject: Feature 1696 Add support for branded zones Applied the patch from the ticket and wrote tests with the changes --- lib/puppet/provider/zone/solaris.rb | 11 +++++++---- lib/puppet/type/zone.rb | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb index 24bbb99ec..a5a18198c 100644 --- a/lib/puppet/provider/zone/solaris.rb +++ b/lib/puppet/provider/zone/solaris.rb @@ -36,9 +36,8 @@ Puppet::Type.type(:zone).provide(:solaris) do # Perform all of our configuration steps. def configure # If the thing is entirely absent, then we need to create the config. - str = %{create -b -set zonepath=%s -} % @resource[:path] + # Is there someway to get this on one line? + str = "create -b #{@resource[:create_args]}\nset zonepath=%s\n" % @resource[:path] # Then perform all of our configuration steps. It's annoying # that we need this much internal info on the resource. @@ -66,7 +65,11 @@ set zonepath=%s end def install - zoneadm :install + if @resource[:install_args] + zoneadm :install, @resource[:install_args].split(" ") + else + zoneadm :install + end end # Look up the current status. diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb index 7601ec47b..8c4261241 100644 --- a/lib/puppet/type/zone.rb +++ b/lib/puppet/type/zone.rb @@ -357,6 +357,14 @@ end end end + newparam(:create_args) do + desc "Arguments to the zonecfg create command. This can be used to create branded zones." + end + + newparam(:install_args) do + desc "Arguments to the zoneadm install command. This can be used to create branded zones." + end + newparam(:realhostname) do desc "The actual hostname of the zone." end -- cgit