summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type.rb20
-rw-r--r--lib/puppet/type/zone.rb16
2 files changed, 26 insertions, 10 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index 0e0628202..13caf1973 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -128,6 +128,11 @@ class Type < Puppet::Element
end
+ # Load all types. Only currently used for documentation.
+ def self.loadall
+ typeloader.loadall
+ end
+
# Do an on-demand plugin load
def self.loadplugin(name)
unless Puppet[:pluginpath].split(":").include?(Puppet[:plugindest])
@@ -213,12 +218,11 @@ class Type < Puppet::Element
end
unless @types.include? name
- begin
- require "puppet/type/#{name}"
+ if typeloader.load(name)
unless @types.include? name
Puppet.warning "Loaded puppet/type/#{name} but no class was created"
end
- rescue LoadError => detail
+ else
# If we can't load it from there, try loading it as a plugin.
loadplugin(name)
end
@@ -227,6 +231,16 @@ class Type < Puppet::Element
@types[name]
end
+ def self.typeloader
+ unless defined? @typeloader
+ @typeloader = Puppet::Autoload.new(self,
+ "puppet/type", :wrap => false
+ )
+ end
+
+ @typeloader
+ end
+
# class methods dealing with type instance management
public
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index de94e51ca..c882e199c 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -287,21 +287,23 @@ end
desc %{The text to go into the sysidcfg file when the zone is first
booted. The best way is to use a template:
+ <pre><code>
# $templatedir/sysidcfg
system_locale=en_US
timezone=GMT
terminal=xterms
security_policy=NONE
- root_password=<%= password %>
+ root_password=&lt;%= password %>
timeserver=localhost
- name_service=DNS {domain_name=<%= domain %>
- name_server=<%= nameserver %>}
- network_interface=primary {hostname=<%= realhostname %>
- ip_address=<%= ip %>
- netmask=<%= netmask %>
+ name_service=DNS {domain_name=&lt;%= domain %>
+ name_server=&lt;%= nameserver %>}
+ network_interface=primary {hostname=&lt;%= realhostname %>
+ ip_address=&lt;%= ip %>
+ netmask=&lt;%= netmask %>
protocol_ipv6=no
- default_route=<%= defaultroute %>}
+ default_route=&lt;%= defaultroute %>}
nfs4_domain=dynamic
+ </code></pre>
And then call that: