diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-13 23:49:53 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-13 23:49:53 +0000 |
| commit | 97c7342cfd6aefc8bff20fd8dc9cae0ee213810c (patch) | |
| tree | 2ee0b39ba9c860227175d475fd68ef5b6eb0aa39 /lib/puppet | |
| parent | 02d397c7c7d08ac6203f231032cc4ab6dcf70dd9 (diff) | |
| download | puppet-97c7342cfd6aefc8bff20fd8dc9cae0ee213810c.tar.gz puppet-97c7342cfd6aefc8bff20fd8dc9cae0ee213810c.tar.xz puppet-97c7342cfd6aefc8bff20fd8dc9cae0ee213810c.zip | |
Adding fixes for solaris zones
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1271 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/type/zone.rb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb index b4dbc7b13..640ed8f99 100644 --- a/lib/puppet/type/zone.rb +++ b/lib/puppet/type/zone.rb @@ -37,16 +37,22 @@ Puppet::Type.newtype(:zone) do end end + rms = [] + adds = [] + # Collect the modifications to make list.sort.uniq.collect do |obj| # Skip objectories that are configured and should be next if tmpis.include?(obj) and @should.include?(obj) if tmpis.include?(obj) - rm(obj) + rms << obj else - add(obj) + adds << obj end - end.reject { |t| t.nil? }.join("\n") + end + + # And then perform all of the removals before any of the adds. + (rms.collect { |o| rm(o) } + adds.collect { |o| add(o) }).join("\n") end # We want all specified directories to be included. @@ -84,6 +90,8 @@ Puppet::Type.newtype(:zone) do newvalue :installed, :up => :install, :down => :stop newvalue :running, :up => :start + defaultto :running + def self.valueindex(value) @parametervalues.index(value) end @@ -233,9 +241,13 @@ end newstate(:pool, ZoneConfigState) do desc "The resource pool for this zone." + + def configtext + "set pool=#{self.should}" + end end - newstate(:inherits, ZoneMultiConfigState) do + newstate(:inherit, ZoneMultiConfigState) do desc "The list of directories that the zone inherits from the global zone. All directories must be fully qualified." @@ -329,7 +341,7 @@ end # by the states. def cfg(str) debug "Executing '%s' in zone %s" % [str, self[:name]] - IO.popen("/usr/sbin/zonecfg -z %s -f -" % self[:name], "w") do |pipe| + IO.popen("/usr/sbin/zonecfg -z %s -f - 2>&1" % self[:name], "w") do |pipe| pipe.puts str end @@ -471,7 +483,7 @@ set zonepath=%s hash[:dir] end - self.is = [:inherits, dirs] + self.is = [:inherit, dirs] when "net": vals = value.collect do |hash| "%s:%s" % [hash[:physical], hash[:address]] |
