1 Enhance the zone provider to configure zones using a zonecfg export file format. |
1 Enhance the zone provider to configure zones using a zonecfg export file format. |
2 Enhance the output of puppet resource zone, and fix zone clone functionality, which omitted '-c'. |
2 Enhance the output of puppet resource zone, and fix zone clone functionality, which omitted '-c'. |
3 |
3 |
4 --- puppet-3.8.3/lib/puppet/provider/zone/solaris.rb.orig 2015-09-21 14:46:28.000000000 -0700 |
4 --- puppet-3.8.6/lib/puppet/provider/zone/solaris.rb.orig 2016-04-19 14:19:58.810028057 -0700 |
5 +++ puppet-3.8.3/lib/puppet/provider/zone/solaris.rb 2015-11-25 15:17:51.503592308 -0800 |
5 +++ puppet-3.8.6/lib/puppet/provider/zone/solaris.rb 2016-04-19 14:20:32.183269425 -0700 |
6 @@ -1,5 +1,5 @@ |
6 @@ -1,5 +1,9 @@ |
|
7 +####################################################################### |
|
8 +# Oracle has modified the originally distributed contents of this file. |
|
9 +####################################################################### |
|
10 + |
7 Puppet::Type.type(:zone).provide(:solaris) do |
11 Puppet::Type.type(:zone).provide(:solaris) do |
8 - desc "Provider for Solaris Zones." |
12 - desc "Provider for Solaris Zones." |
9 + desc "Provider for Solaris zones." |
13 + desc "Provider for Solaris zones." |
10 |
14 |
11 commands :adm => "/usr/sbin/zoneadm", :cfg => "/usr/sbin/zonecfg" |
15 commands :adm => "/usr/sbin/zoneadm", :cfg => "/usr/sbin/zonecfg" |
12 defaultfor :osfamily => :solaris |
16 defaultfor :osfamily => :solaris |
13 @@ -8,129 +8,84 @@ |
17 @@ -8,129 +12,84 @@ |
14 |
18 |
15 # Convert the output of a list into a hash |
19 # Convert the output of a list into a hash |
16 def self.line2hash(line) |
20 def self.line2hash(line) |
17 - fields = [:id, :name, :ensure, :path, :uuid, :brand, :iptype] |
21 - fields = [:id, :name, :ensure, :path, :uuid, :brand, :iptype] |
18 + fields = [:id, :name, :ensure, :zonepath, :uuid, :brand, :iptype ] |
22 + fields = [:id, :name, :ensure, :zonepath, :uuid, :brand, :iptype ] |
151 + if !@resource[:zonecfg_export].nil? && @resource[:archive].nil? |
155 + if !@resource[:zonecfg_export].nil? && @resource[:archive].nil? |
152 + command = "#{command(:cfg)} -z #{@resource[:name]} \'#{str}\'" |
156 + command = "#{command(:cfg)} -z #{@resource[:name]} \'#{str}\'" |
153 + end |
157 + end |
154 end |
158 end |
155 - end |
159 - end |
156 - |
160 |
157 - def my_properties |
161 - def my_properties |
158 - [:path, :iptype, :autoboot, :pool, :shares, :ip, :dataset, :inherit] |
162 - [:path, :iptype, :autoboot, :pool, :shares, :ip, :dataset, :inherit] |
159 - end |
163 - end |
160 - |
164 - |
161 - # Perform all of our configuration steps. |
165 - # Perform all of our configuration steps. |
162 - def configure |
166 - def configure |
163 - self.fail "Path is required" unless @resource[:path] |
167 - self.fail "Path is required" unless @resource[:path] |
164 - arr = ["create -b #{@resource[:create_args]}"] |
168 - arr = ["create -b #{@resource[:create_args]}"] |
165 |
169 - |
166 - # Then perform all of our configuration steps. It's annoying |
170 - # Then perform all of our configuration steps. It's annoying |
167 - # that we need this much internal info on the resource. |
171 - # that we need this much internal info on the resource. |
168 - self.resource.properties.each do |property| |
172 - self.resource.properties.each do |property| |
169 - next unless my_properties.include? property.name |
173 - next unless my_properties.include? property.name |
170 - method = (property.name.to_s + '_conf').intern |
174 - method = (property.name.to_s + '_conf').intern |
255 - def processing? |
259 - def processing? |
256 + def processing? |
260 + def processing? |
257 hash = status |
261 hash = status |
258 return false unless hash |
262 return false unless hash |
259 ["incomplete", "ready", "shutting_down"].include? hash[:ensure] |
263 ["incomplete", "ready", "shutting_down"].include? hash[:ensure] |
260 @@ -214,7 +174,6 @@ |
264 @@ -214,7 +178,6 @@ |
261 # |
265 # |
262 def getconfig |
266 def getconfig |
263 output = zonecfg :info |
267 output = zonecfg :info |
264 - |
268 - |
265 name = nil |
269 name = nil |
266 current = nil |
270 current = nil |
267 hash = {} |
271 hash = {} |
268 @@ -244,14 +203,9 @@ |
272 @@ -244,14 +207,9 @@ |
269 hash |
273 hash |
270 end |
274 end |
271 |
275 |
272 - # Execute a configuration string. Can't be private because it's called |
276 - # Execute a configuration string. Can't be private because it's called |
273 - # by the properties. |
277 - # by the properties. |
279 # Check the sysidcfg stuff |
283 # Check the sysidcfg stuff |
280 + if ['5.10'].include? Facter.value(:kernelrelease) |
284 + if ['5.10'].include? Facter.value(:kernelrelease) |
281 if cfg = @resource[:sysidcfg] |
285 if cfg = @resource[:sysidcfg] |
282 self.fail "Path is required" unless @resource[:path] |
286 self.fail "Path is required" unless @resource[:path] |
283 zoneetc = File.join(@resource[:path], "root", "etc") |
287 zoneetc = File.join(@resource[:path], "root", "etc") |
284 @@ -272,7 +226,9 @@ |
288 @@ -272,7 +230,9 @@ |
285 end |
289 end |
286 end |
290 end |
287 end |
291 end |
288 + end |
292 + end |
289 |
293 |
290 + # Boots the zone |
294 + # Boots the zone |
291 zoneadm :boot |
295 zoneadm :boot |
292 end |
296 end |
293 |
297 |
294 @@ -285,64 +241,35 @@ |
298 @@ -285,64 +245,35 @@ |
295 end |
299 end |
296 |
300 |
297 main = self.class.line2hash(output.chomp) |
301 main = self.class.line2hash(output.chomp) |
298 - |
302 - |
299 - # Now add in the configuration information |
303 - # Now add in the configuration information |