From e2ce790b57723453ac8f52e17b6c56335b64036c Mon Sep 17 00:00:00 2001 From: Martin Englund Date: Tue, 20 Oct 2009 11:41:07 +0100 Subject: Fixed #2737 - The zone provider needs to get acquainted with OpenSolaris --- lib/puppet/provider/zone/solaris.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/puppet/provider') diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb index 778b9e0a1..52007bb25 100644 --- a/lib/puppet/provider/zone/solaris.rb +++ b/lib/puppet/provider/zone/solaris.rb @@ -156,11 +156,16 @@ Puppet::Type.type(:zone).provide(:solaris) do def start # Check the sysidcfg stuff if cfg = @resource[:sysidcfg] - path = File.join(@resource[:path], "root", "etc", "sysidcfg") + zoneetc = File.join(@resource[:path], "root", "etc") + sysidcfg = File.join(zoneetc, "sysidcfg") - unless File.exists?(path) + # if the zone root isn't present "ready" the zone + # which makes zoneadmd mount the zone root + zoneadm :ready unless File.directory?(zoneetc) + + unless File.exists?(sysidcfg) begin - File.open(path, "w", 0600) do |f| + File.open(sysidcfg, "w", 0600) do |f| f.puts cfg end rescue => detail @@ -193,6 +198,10 @@ Puppet::Type.type(:zone).provide(:solaris) do main end + def ready + zoneadm :ready + end + def stop zoneadm :halt end -- cgit