summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider
diff options
context:
space:
mode:
authorMartin Englund <martin.englund@sun.com>2009-10-20 11:41:07 +0100
committerJames Turnbull <james@lovedthanlost.net>2009-10-24 08:55:02 +1100
commite2ce790b57723453ac8f52e17b6c56335b64036c (patch)
treeab92aa30380f43ed9e80beb307455a5ebc339eaf /lib/puppet/provider
parentaea1e5fa34412dd843b937263d92c4fab9628b83 (diff)
downloadpuppet-e2ce790b57723453ac8f52e17b6c56335b64036c.tar.gz
puppet-e2ce790b57723453ac8f52e17b6c56335b64036c.tar.xz
puppet-e2ce790b57723453ac8f52e17b6c56335b64036c.zip
Fixed #2737 - The zone provider needs to get acquainted with OpenSolaris
Diffstat (limited to 'lib/puppet/provider')
-rw-r--r--lib/puppet/provider/zone/solaris.rb15
1 files changed, 12 insertions, 3 deletions
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