summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-08-12 13:53:13 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-08-12 13:53:29 -0700
commit1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac (patch)
tree3c6495838d1b876528cb4522de3484c44749140d
parentd5db8db116aff58215ab0feebd7ec02086040f51 (diff)
parent0f56c1b02d40f1f8552d933dd78b24745937b137 (diff)
downloadpuppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.tar.gz
puppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.tar.xz
puppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.zip
Merge branch 'next'
This synchronizes the 2.7 master branch with 2.6.1RC2
-rw-r--r--CHANGELOG39
-rwxr-xr-xconf/solaris/smf/svc-puppetd2
-rwxr-xr-xconf/solaris/smf/svc-puppetmasterd2
-rw-r--r--ext/puppetstoredconfigclean.rb6
-rw-r--r--lib/puppet.rb2
-rw-r--r--lib/puppet/application.rb2
-rw-r--r--lib/puppet/application/agent.rb4
-rw-r--r--lib/puppet/application/doc.rb38
-rw-r--r--lib/puppet/application/master.rb3
-rw-r--r--lib/puppet/configurer.rb4
-rw-r--r--lib/puppet/defaults.rb82
-rw-r--r--lib/puppet/indirector/facts/memory.rb2
-rw-r--r--lib/puppet/indirector/node/ldap.rb60
-rw-r--r--lib/puppet/indirector/node/memory.rb2
-rw-r--r--lib/puppet/network/http/handler.rb2
-rw-r--r--lib/puppet/network/http/rack/rest.rb2
-rw-r--r--lib/puppet/parameter/value_collection.rb6
-rw-r--r--lib/puppet/parser/ast/function.rb1
-rw-r--r--lib/puppet/parser/ast/leaf.rb2
-rw-r--r--lib/puppet/parser/ast/resource.rb7
-rw-r--r--lib/puppet/parser/ast/resource_reference.rb11
-rw-r--r--lib/puppet/parser/compiler.rb1
-rw-r--r--lib/puppet/parser/files.rb2
-rw-r--r--lib/puppet/parser/functions.rb4
-rw-r--r--lib/puppet/parser/functions/defined.rb2
-rw-r--r--lib/puppet/parser/functions/extlookup.rb19
-rw-r--r--lib/puppet/parser/functions/file.rb2
-rw-r--r--lib/puppet/parser/functions/inline_template.rb11
-rw-r--r--lib/puppet/parser/functions/md5.rb5
-rw-r--r--lib/puppet/parser/functions/realize.rb2
-rw-r--r--lib/puppet/parser/functions/regsubst.rb38
-rw-r--r--lib/puppet/parser/functions/require.rb5
-rw-r--r--lib/puppet/parser/functions/split.rb2
-rw-r--r--lib/puppet/parser/functions/sprintf.rb2
-rw-r--r--lib/puppet/parser/functions/template.rb6
-rw-r--r--lib/puppet/parser/functions/versioncmp.rb24
-rw-r--r--lib/puppet/parser/lexer.rb24
-rw-r--r--lib/puppet/parser/resource.rb6
-rw-r--r--lib/puppet/parser/resource/param.rb2
-rw-r--r--lib/puppet/parser/scope.rb35
-rw-r--r--lib/puppet/property.rb10
-rw-r--r--lib/puppet/provider.rb6
-rw-r--r--lib/puppet/provider/group/groupadd.rb2
-rw-r--r--lib/puppet/provider/group/ldap.rb6
-rw-r--r--lib/puppet/provider/group/pw.rb2
-rwxr-xr-xlib/puppet/provider/package/apple.rb2
-rwxr-xr-xlib/puppet/provider/package/apt.rb2
-rwxr-xr-xlib/puppet/provider/package/aptitude.rb2
-rw-r--r--lib/puppet/provider/package/aptrpm.rb2
-rwxr-xr-xlib/puppet/provider/package/blastwave.rb2
-rwxr-xr-xlib/puppet/provider/package/dpkg.rb4
-rwxr-xr-xlib/puppet/provider/package/fink.rb2
-rwxr-xr-xlib/puppet/provider/package/gem.rb2
-rwxr-xr-xlib/puppet/provider/package/openbsd.rb2
-rwxr-xr-xlib/puppet/provider/package/rpm.rb2
-rw-r--r--lib/puppet/provider/package/rug.rb2
-rwxr-xr-xlib/puppet/provider/package/sunfreeware.rb4
-rw-r--r--lib/puppet/provider/package/up2date.rb2
-rw-r--r--lib/puppet/provider/package/urpmi.rb2
-rwxr-xr-xlib/puppet/provider/package/yum.rb2
-rw-r--r--lib/puppet/provider/package/zypper.rb2
-rwxr-xr-xlib/puppet/provider/service/base.rb2
-rw-r--r--lib/puppet/provider/service/bsd.rb4
-rwxr-xr-xlib/puppet/provider/service/debian.rb4
-rw-r--r--lib/puppet/provider/service/gentoo.rb4
-rwxr-xr-xlib/puppet/provider/service/init.rb4
-rwxr-xr-xlib/puppet/provider/service/redhat.rb4
-rw-r--r--lib/puppet/provider/user/ldap.rb6
-rw-r--r--lib/puppet/provider/user/pw.rb2
-rw-r--r--lib/puppet/provider/user/user_role_add.rb2
-rw-r--r--lib/puppet/provider/user/useradd.rb2
-rw-r--r--lib/puppet/reference/configuration.rb71
-rw-r--r--lib/puppet/reference/indirection.rb5
-rw-r--r--lib/puppet/reference/metaparameter.rb8
-rw-r--r--lib/puppet/reference/network.rb8
-rw-r--r--lib/puppet/reference/providers.rb8
-rw-r--r--lib/puppet/reference/report.rb11
-rw-r--r--lib/puppet/reference/type.rb28
-rw-r--r--lib/puppet/reports/http.rb2
-rw-r--r--lib/puppet/reports/rrdgraph.rb17
-rw-r--r--lib/puppet/reports/store.rb4
-rw-r--r--lib/puppet/reports/tagmail.rb25
-rw-r--r--lib/puppet/resource.rb128
-rw-r--r--lib/puppet/resource/type_collection.rb8
-rw-r--r--lib/puppet/transaction/resource_harness.rb2
-rw-r--r--lib/puppet/type.rb170
-rw-r--r--lib/puppet/type/augeas.rb89
-rw-r--r--lib/puppet/type/computer.rb4
-rwxr-xr-xlib/puppet/type/cron.rb56
-rwxr-xr-xlib/puppet/type/exec.rb133
-rw-r--r--lib/puppet/type/file.rb50
-rwxr-xr-xlib/puppet/type/file/ensure.rb26
-rwxr-xr-xlib/puppet/type/file/mode.rb12
-rw-r--r--lib/puppet/type/file/selcontext.rb10
-rwxr-xr-xlib/puppet/type/file/source.rb52
-rwxr-xr-xlib/puppet/type/filebucket.rb11
-rwxr-xr-xlib/puppet/type/group.rb3
-rwxr-xr-xlib/puppet/type/host.rb9
-rw-r--r--lib/puppet/type/k5login.rb6
-rw-r--r--lib/puppet/type/macauthorization.rb3
-rwxr-xr-xlib/puppet/type/mailalias.rb1
-rwxr-xr-xlib/puppet/type/maillist.rb1
-rw-r--r--lib/puppet/type/mcx.rb18
-rwxr-xr-xlib/puppet/type/mount.rb19
-rw-r--r--lib/puppet/type/notify.rb1
-rw-r--r--lib/puppet/type/package.rb70
-rw-r--r--lib/puppet/type/resources.rb6
-rwxr-xr-xlib/puppet/type/schedule.rb21
-rw-r--r--lib/puppet/type/selboolean.rb9
-rw-r--r--lib/puppet/type/selmodule.rb7
-rw-r--r--lib/puppet/type/service.rb18
-rw-r--r--lib/puppet/type/ssh_authorized_key.rb5
-rwxr-xr-xlib/puppet/type/sshkey.rb11
-rw-r--r--lib/puppet/type/stage.rb9
-rwxr-xr-xlib/puppet/type/tidy.rb6
-rwxr-xr-xlib/puppet/type/user.rb3
-rw-r--r--lib/puppet/type/yumrepo.rb5
-rwxr-xr-xlib/puppet/type/zfs.rb3
-rw-r--r--lib/puppet/type/zone.rb56
-rwxr-xr-xlib/puppet/type/zpool.rb15
-rw-r--r--lib/puppet/util/autoload.rb22
-rwxr-xr-xlib/puppet/util/command_line/puppetdoc10
-rwxr-xr-xlib/puppet/util/command_line/puppetrun2
-rwxr-xr-xlib/puppet/util/command_line/ralsh26
-rw-r--r--lib/puppet/util/docs.rb17
-rw-r--r--lib/puppet/util/monkey_patches.rb2
-rw-r--r--lib/puppet/util/nagios_maker.rb9
-rw-r--r--lib/puppet/util/provider_features.rb4
-rw-r--r--lib/puppet/util/reference.rb55
-rw-r--r--spec/integration/indirector/bucket_file/rest_spec.rb1
-rwxr-xr-xspec/integration/indirector/certificate/rest_spec.rb1
-rwxr-xr-xspec/integration/indirector/certificate_request/rest_spec.rb1
-rwxr-xr-xspec/integration/indirector/certificate_revocation_list/rest_spec.rb1
-rw-r--r--spec/integration/indirector/report/rest_spec.rb1
-rwxr-xr-xspec/integration/indirector/rest_spec.rb1
-rwxr-xr-xspec/integration/network/server/webrick_spec.rb1
-rwxr-xr-xspec/integration/parser/compiler_spec.rb43
-rwxr-xr-xspec/integration/ssl/certificate_authority_spec.rb1
-rwxr-xr-xspec/integration/ssl/certificate_request_spec.rb1
-rwxr-xr-xspec/integration/ssl/certificate_revocation_list_spec.rb1
-rwxr-xr-xspec/integration/ssl/host_spec.rb1
-rwxr-xr-xspec/unit/indirector/node/ldap_spec.rb40
-rwxr-xr-xspec/unit/network/http/rack/rest_spec.rb6
-rwxr-xr-xspec/unit/node/facts_spec.rb15
-rwxr-xr-xspec/unit/parameter/value_collection_spec.rb4
-rwxr-xr-xspec/unit/parser/ast/leaf_spec.rb4
-rwxr-xr-xspec/unit/parser/ast/resource_reference_spec.rb5
-rwxr-xr-xspec/unit/parser/ast/resource_spec.rb7
-rw-r--r--spec/unit/parser/files_spec.rb6
-rwxr-xr-xspec/unit/parser/functions/extlookup_spec.rb16
-rw-r--r--spec/unit/parser/functions/include_spec.rb22
-rwxr-xr-xspec/unit/parser/functions/require_spec.rb2
-rwxr-xr-xspec/unit/parser/functions/tag_spec.rb1
-rwxr-xr-xspec/unit/parser/lexer_spec.rb7
-rwxr-xr-xspec/unit/parser/resource_spec.rb12
-rw-r--r--spec/unit/parser/type_loader_spec.rb2
-rwxr-xr-xspec/unit/rails/resource_spec.rb2
-rwxr-xr-xspec/unit/resource/catalog_spec.rb2
-rw-r--r--spec/unit/resource/type_collection_spec.rb27
-rwxr-xr-xspec/unit/resource/type_spec.rb3
-rwxr-xr-xspec/unit/resource_spec.rb36
-rwxr-xr-xspec/unit/transaction/resource_harness_spec.rb2
-rwxr-xr-xspec/unit/type/schedule_spec.rb2
-rw-r--r--tasks/rake/tracdocs.rake8
-rwxr-xr-xtest/certmgr/support.rb3
-rwxr-xr-xtest/language/parser.rb12
-rwxr-xr-xtest/lib/puppettest.rb4
167 files changed, 1059 insertions, 1202 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 421b5136b..d7861e04c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,44 @@
+2.6.1rc2
+========
+252c9b8 Further RST to Markdown fixes for types, values, tests
+1157e8d Updated all types to Markdown output
+fef8800 Updated reference output to generate valid Markdown
+79e0a2e Reformatting documentation from RST to MarkDown (#4509) Signed-off-by: Jes Fraser <jes@gadget.geek.nz>
+62435e5 Rewrote functions documentation to Markdown
+e4b2aa6 Removed legacy Trac code
+8ddea2a Maint. Passenger fix broke a test
+f43e87b Fix for #4476 -- rails calling yaml internals
+a23d80a Fixes #4485 -- single quoted strings should not treat \n as new line
+8e31b52 Passenger needs HTTP headers values to be string
+037bb32 [#4404] Remove requirement for source on Parser::Resource::Param
+0e4bc62 [#4364] Fix failing spec due to incorrect loglevel
+3a6ca54 Fix #4458 - Do not dump the whole environment when instances can't be found
+d909827 Fix for #4465 -- earlier "feature" patch broke ldap
+47005aa Maint -- tests need to respect RFC-952
+6aac8f0 [#4467] Make Puppet Master respect facts_terminus settings
+1cba9a7 added md5 support as requested in http://serverfault.com/questions/166199/puppet-md5-sum-of-string
+1dfd2b6 [#4381] extlookup shouldn't trigger reparses of .pp files
+be2b1f3 [#4370] Fixes extlookup precedence getting overwritten between runs
+03808fd Fixed #4364 - Reduced audit msg from info to debug
+539b57c [#4347] run_mode was colliding with --mode for "puppet doc"
+1faebdd [#4423] repair parameterized class instantiation
+37568bd [#4423] class { shouldn't get stored on the namespace stack
+449315a [#4397]+[#4344] Move type-name resolution out of Puppet::Resource into the AST resources.
+daa801b [#4344] Temporary fix to stop agent from importing modules
+00ebf01 [#4344] Fix for failing templates when module name matches file in local dir.
+e32320e [#4336] "reportdir" was in the wrong section
+0f9672a Fixed #4311 - Typo in defaults.rb
+f54d843 Fix #4461 - attempt to fix another performance issue
+2c21fae Fix for #4300 Solaris svc files need new pid filenames
+83c2419 [#4284] Fix failing specs run as root due to missing puppet group
+8237f68 [#4242] Fixed (removed) a broken unit test
+d5ad0fb Removed eventual documentation line ... eventually came
+871e6fd Fixed #4368 - Updated clean stored configs ext script for new config sections
+cb64477 Updated version to 2.6.1
+
2.6.1rc1
========
+ecf44e4 Updated CHANGELOG for 2.6.1rc1
bdfcac5 Update Red Hat spec file for 2.6.0
9f08e7c Feature: puppet-load - a tool to stress-test master compilation
ef9a4a6 Fix #4245 - default insertion of ACL is not thread safe
diff --git a/conf/solaris/smf/svc-puppetd b/conf/solaris/smf/svc-puppetd
index 9036b505c..b6cf05736 100755
--- a/conf/solaris/smf/svc-puppetd
+++ b/conf/solaris/smf/svc-puppetd
@@ -12,7 +12,7 @@ exec_prefix=/opt/csw
sysconfdir=/opt/csw/etc
sbindir=/opt/csw/sbin
-pidfile=/var/lib/puppet/run/puppetd.pid
+pidfile=/var/lib/puppet/run/agent.pid
case "$1" in
start)
diff --git a/conf/solaris/smf/svc-puppetmasterd b/conf/solaris/smf/svc-puppetmasterd
index 34f5a62e6..80e3d464a 100755
--- a/conf/solaris/smf/svc-puppetmasterd
+++ b/conf/solaris/smf/svc-puppetmasterd
@@ -8,7 +8,7 @@ exec_prefix=/opt/csw
sysconfdir=/opt/csw/etc
sbindir=/opt/csw/sbin
-pidfile=/var/lib/puppet/run/puppetmasterd.pid
+pidfile=/var/lib/puppet/run/master.pid
case "$1" in
start)
diff --git a/ext/puppetstoredconfigclean.rb b/ext/puppetstoredconfigclean.rb
index 34dd72f5d..9b7b0c8a7 100644
--- a/ext/puppetstoredconfigclean.rb
+++ b/ext/puppetstoredconfigclean.rb
@@ -19,11 +19,11 @@ end
opts = GetoptLong.new(
-
+
[ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ],
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--usage", "-u", GetoptLong::NO_ARGUMENT ],
-
+
[ "--version", "-v", GetoptLong::NO_ARGUMENT ]
)
@@ -54,7 +54,7 @@ printusage(1) unless ARGV.size > 0
require 'puppet/rails'
Puppet[:config] = config
Puppet.parse_config
-pm_conf = Puppet.settings.instance_variable_get(:@values)[:puppetmasterd]
+pm_conf = Puppet.settings.instance_variable_get(:@values)[:master]
adapter = pm_conf[:dbadapter]
args = {:adapter => adapter, :log_level => pm_conf[:rails_loglevel]}
diff --git a/lib/puppet.rb b/lib/puppet.rb
index 902f5bf5c..18c1e8cbd 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -24,7 +24,7 @@ require 'puppet/util/run_mode'
# it's also a place to find top-level commands like 'debug'
module Puppet
- PUPPETVERSION = '2.6.0'
+ PUPPETVERSION = '2.6.1'
def Puppet.version
PUPPETVERSION
diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb
index 0a8fbc155..2fec38bf2 100644
--- a/lib/puppet/application.rb
+++ b/lib/puppet/application.rb
@@ -285,7 +285,7 @@ class Application
Puppet.settings.set_value(:name, Puppet.application_name.to_s, :mutable_defaults)
Puppet.settings.set_value(:logdir, Puppet.run_mode.logopts, :mutable_defaults)
Puppet.settings.set_value(:rundir, Puppet.run_mode.run_dir, :mutable_defaults)
- Puppet.settings.set_value(:mode, Puppet.run_mode.name.to_s, :mutable_defaults)
+ Puppet.settings.set_value(:run_mode, Puppet.run_mode.name.to_s, :mutable_defaults)
end
require 'puppet'
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index f0e7f4d8f..2b75505fd 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -219,6 +219,10 @@ class Puppet::Application::Agent < Puppet::Application
Puppet.settings.use :main, :agent, :ssl
+ # Always ignoreimport for agent. It really shouldn't even try to import,
+ # but this is just a temporary band-aid.
+ Puppet[:ignoreimport] = true
+
# We need to specify a ca location for all of the SSL-related i
# indirected classes to work; in fingerprint mode we just need
# access to the local files and we don't need a ca.
diff --git a/lib/puppet/application/doc.rb b/lib/puppet/application/doc.rb
index 66aa6c8a1..1f6c63286 100644
--- a/lib/puppet/application/doc.rb
+++ b/lib/puppet/application/doc.rb
@@ -56,7 +56,7 @@ class Puppet::Application::Doc < Puppet::Application
end
def run_command
- return[:rdoc, :trac, :markdown].include?(options[:mode]) ? send(options[:mode]) : other
+ return[:rdoc].include?(options[:mode]) ? send(options[:mode]) : other
end
def rdoc
@@ -72,7 +72,7 @@ class Puppet::Application::Doc < Puppet::Application
Puppet.settings.setdefaults(
"puppetdoc",
-
+
"document_all" => [false, "Document all resources"]
)
Puppet.settings[:document_all] = options[:all] || false
@@ -92,40 +92,6 @@ class Puppet::Application::Doc < Puppet::Application
exit exit_code
end
- def trac
- require 'puppet/util/reference'
- options[:references].each do |name|
- section = Puppet::Util::Reference.reference(name) or raise "Could not find section #{name}"
- section.trac unless options[:mode] == :pdf
- end
- end
-
- def markdown
- text = ""
- with_contents = false
- exit_code = 0
- require 'puppet/util/reference'
- options[:references].sort { |a,b| a.to_s <=> b.to_s }.each do |name|
- raise "Could not find reference #{name}" unless section = Puppet::Util::Reference.reference(name)
-
- begin
- # Add the per-section text, but with no ToC
- text += section.send(options[:format], with_contents)
- text += Puppet::Util::Reference.footer
- text.gsub!(/`\w+\s+([^`]+)`:trac:/) { |m| $1 }
- Puppet::Util::Reference.markdown(name, text)
- text = ""
- rescue => detail
- puts detail.backtrace
- $stderr.puts "Could not generate reference #{name}: #{detail}"
- exit_code = 1
- next
- end
- end
-
- exit exit_code
- end
-
def other
text = ""
with_contents = options[:references].length <= 1
diff --git a/lib/puppet/application/master.rb b/lib/puppet/application/master.rb
index 777a50eaa..fde474907 100644
--- a/lib/puppet/application/master.rb
+++ b/lib/puppet/application/master.rb
@@ -138,9 +138,6 @@ class Puppet::Application::Master < Puppet::Application
Puppet.settings.use :main, :master, :ssl
- # A temporary solution, to at least make the master work for now.
- Puppet::Node::Facts.terminus_class = :yaml
-
# Cache our nodes in yaml. Currently not configurable.
Puppet::Node.cache_class = :yaml
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb
index 327955b03..31d31c2d2 100644
--- a/lib/puppet/configurer.rb
+++ b/lib/puppet/configurer.rb
@@ -158,6 +158,10 @@ class Puppet::Configurer
return
end
ensure
+ # Make sure we forget the retained module_directories of any autoload
+ # we might have used.
+ Thread.current[:env_module_directories] = nil
+
# Now close all of our existing http connections, since there's no
# reason to leave them lying open.
Puppet::Network::HttpPool.clear_http_instances
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 84e2d93fc..318ff416b 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -2,12 +2,12 @@
module Puppet
setdefaults(:main,
:confdir => [Puppet.run_mode.conf_dir, "The main Puppet configuration directory. The default for this parameter is calculated based on the user. If the process
- is running as root or the user that ``puppet master`` is supposed to run as, it defaults to a system directory, but if it's running as any other user,
- it defaults to being in ``~``."],
+ is running as root or the user that `puppet master` is supposed to run as, it defaults to a system directory, but if it's running as any other user,
+ it defaults to being in `~`."],
:vardir => [Puppet.run_mode.var_dir, "Where Puppet stores dynamic and growing data. The default for this parameter is calculated specially, like `confdir`_."],
:name => [Puppet.application_name.to_s, "The name of the application, if we are running as one. The
- default is essentially $0 without the path or ``.rb``."],
- :mode => [Puppet.run_mode.name.to_s, "The effective 'run mode' of the application: master, agent, or user."]
+ default is essentially $0 without the path or `.rb`."],
+ :run_mode => [Puppet.run_mode.name.to_s, "The effective 'run mode' of the application: master, agent, or user."]
)
setdefaults(:main, :logdir => Puppet.run_mode.logopts)
@@ -44,8 +44,8 @@ module Puppet
specify 'all'. This feature is only available in Puppet versions
higher than 0.18.4."],
:color => ["ansi", "Whether to use colors when logging to the console.
- Valid values are ``ansi`` (equivalent to ``true``), ``html`` (mostly
- used during testing with TextMate), and ``false``, which produces
+ Valid values are `ansi` (equivalent to `true`), `html` (mostly
+ used during testing with TextMate), and `false`, which produces
no color."],
:mkusers => [false,
"Whether to create the necessary user and group that puppet agent will
@@ -92,18 +92,18 @@ module Puppet
:authconfig => [ "$confdir/namespaceauth.conf",
"The configuration file that defines the rights to the different
namespaces and methods. This can be used as a coarse-grained
- authorization system for both ``puppet agent`` and ``puppet master``."
+ authorization system for both `puppet agent` and `puppet master`."
],
:environment => {:default => "production", :desc => "The environment Puppet is running in. For clients
- (e.g., ``puppet agent``) this determines the environment itself, which
- is used to find modules and much more. For servers (i.e., ``puppet master``) this provides the default environment for nodes
+ (e.g., `puppet agent`) this determines the environment itself, which
+ is used to find modules and much more. For servers (i.e., `puppet master`) this provides the default environment for nodes
we know nothing about."
},
:diff_args => ["-u", "Which arguments to pass to the diff command when printing differences between files."],
:diff => ["diff", "Which diff command to use when printing differences between files."],
:show_diff => [false, "Whether to print a contextual diff when files are being replaced. The diff
is printed on stdout, so this option is meaningless unless you are running Puppet interactively.
- This feature currently requires the ``diff/lcs`` Ruby library."],
+ This feature currently requires the `diff/lcs` Ruby library."],
:daemonize => { :default => true,
:desc => "Send the process into the background. This is the default.",
:short => "D"
@@ -115,7 +115,7 @@ module Puppet
:node_terminus => ["plain", "Where to find information about nodes."],
:catalog_terminus => ["compiler", "Where to get node catalogs. This is useful to change if, for instance,
you'd like to pre-compile catalogs and store them in memcached or some other easily-accessed store."],
- :facts_terminus => ["facter", "Where to get node facts."],
+ :facts_terminus => [Puppet.application_name.to_s == "master" ? 'yaml' : 'facter', "The node facts terminus."],
:httplog => { :default => "$logdir/http.log",
:owner => "root",
:mode => 0640,
@@ -135,7 +135,7 @@ module Puppet
:queue_source => ["stomp://localhost:61613/", "Which type of queue to use for asynchronous processing. If your stomp server requires
authentication, you can include it in the URI as long as your stomp client library is at least 1.1.1"],
:async_storeconfigs => {:default => false, :desc => "Whether to use a queueing system to provide asynchronous database integration.
- Requires that ``puppetqd`` be running and that 'PSON' support for ruby be installed.",
+ Requires that `puppetqd` be running and that 'PSON' support for ruby be installed.",
:hook => proc do |value|
if value
# This reconfigures the terminii for Node, Facts, and Catalog
@@ -266,7 +266,6 @@ module Puppet
to all clients. If enabled, CA chaining will almost definitely not work."]
)
-
setdefaults(
:ca,
:ca_name => ["$certname", "The name to use the Certificate Authority certificate."],
@@ -385,7 +384,7 @@ module Puppet
:manifestdir => ["$confdir/manifests", "Where puppet master looks for its manifests."],
:manifest => ["$manifestdir/site.pp", "The entry-point manifest for puppet master."],
:code => ["", "Code to parse directly. This is essentially only used
- by ``puppet``, and should only be set if you're writing your own Puppet
+ by `puppet`, and should only be set if you're writing your own Puppet
executable"],
:masterlog => { :default => "$logdir/puppetmaster.log",
:owner => "service",
@@ -419,7 +418,7 @@ module Puppet
:rest_authconfig => [ "$confdir/auth.conf",
"The configuration file that defines the rights to the different
rest indirections. This can be used as a fine-grained
- authorization system for ``puppet master``."
+ authorization system for `puppet master`."
],
:ca => [true, "Wether the master should function as a certificate authority."],
:modulepath => {:default => "$confdir/modules:/usr/share/puppet/modules",
@@ -427,7 +426,7 @@ module Puppet
directories.", :type => :setting }, # We don't want this to be considered a file, since it's multiple files.
:ssl_client_header => ["HTTP_X_CLIENT_DN", "The header containing an authenticated
client's SSL DN. Only used with Mongrel. This header must be set by the proxy
- to the authenticated client's SSL DN (e.g., ``/CN=puppet.puppetlabs.com``).
+ to the authenticated client's SSL DN (e.g., `/CN=puppet.puppetlabs.com`).
See http://projects.puppetlabs.com/projects/puppet/wiki/Using_Mongrel for more information."],
:ssl_client_verify_header => ["HTTP_X_CLIENT_VERIFY", "The header containing the status
message of the client verification. Only used with Mongrel. This header must be set by the proxy
@@ -441,9 +440,18 @@ module Puppet
:desc => "The directory in which serialized data is stored, usually in a subdirectory."},
:reports => ["store",
"The list of reports to generate. All reports are looked for
- in puppet/reports/name.rb, and multiple report names should be
+ in `puppet/reports/name.rb`, and multiple report names should be
comma-separated (whitespace is okay)."
],
+ :reportdir => {:default => "$vardir/reports",
+ :mode => 0750,
+ :owner => "service",
+ :group => "service",
+ :desc => "The directory in which to store reports
+ received from the client. Each client gets a separate
+ subdirectory."},
+ :reporturl => ["http://localhost:3000/reports",
+ "The URL used by the http reports processor to send reports"],
:fileserverconfig => ["$confdir/fileserver.conf", "Where the fileserver configuration is stored."],
:rrddir => {:default => "$vardir/rrd",
:owner => "service",
@@ -479,7 +487,7 @@ module Puppet
:mode => 0644,
:desc => "The file in which puppet agent stores a list of the classes
associated with the retrieved configuration. Can be loaded in
- the separate ``puppet`` executable using the ``--loadclasses``
+ the separate `puppet` executable using the `--loadclasses`
option."},
:puppetdlog => { :default => "$logdir/puppetd.log",
:owner => "root",
@@ -496,8 +504,8 @@ module Puppet
"How often puppet agent applies the client configuration; in seconds."],
:listen => [false, "Whether puppet agent should listen for
connections. If this is true, then by default only the
- ``runner`` server is started, which allows remote authorized
- and authenticated nodes to connect and trigger ``puppet agent``
+ `runner` server is started, which allows remote authorized
+ and authenticated nodes to connect and trigger `puppet agent`
runs."],
:ca_server => ["$server", "The server to use for certificate
authority requests. It's a separate server because it cannot
@@ -595,7 +603,7 @@ module Puppet
"Where Puppet should store plugins that it pulls down from the central
server."],
:pluginsource => ["puppet://$server/plugins",
- "From where to retrieve plugins. The standard Puppet ``file`` type
+ "From where to retrieve plugins. The standard Puppet `file` type
is used for retrieval, so anything that is a valid file source can
be used here."],
:pluginsync => [false, "Whether plugins should be synced with the central server."],
@@ -607,7 +615,7 @@ module Puppet
setdefaults(
:main,
- :factpath => {:default => "$vardir/lib/facter/${File::PATH_SEPARATOR}$vardir/facts",
+ :factpath => {:default => "$vardir/lib/facter:$vardir/facts",
:desc => "Where Puppet should look for facts. Multiple directories should
be colon-separated, like normal PATH variables.",
@@ -618,20 +626,11 @@ module Puppet
"Where Puppet should store facts that it pulls down from the central
server."],
:factsource => ["puppet://$server/facts/",
- "From where to retrieve facts. The standard Puppet ``file`` type
+ "From where to retrieve facts. The standard Puppet `file` type
is used for retrieval, so anything that is a valid file source can
be used here."],
:factsync => [false, "Whether facts should be synced with the central server."],
- :factsignore => [".svn CVS", "What files to ignore when pulling down facts."],
- :reportdir => {:default => "$vardir/reports",
- :mode => 0750,
- :owner => "service",
- :group => "service",
- :desc => "The directory in which to store reports
- received from the client. Each client gets a separate
- subdirectory."},
- :reporturl => ["http://localhost:3000/reports",
- "The URL used by the http reports processor to send reports"]
+ :factsignore => [".svn CVS", "What files to ignore when pulling down facts."]
)
@@ -644,7 +643,6 @@ module Puppet
:smtpserver => ["none", "The server through which to send email reports."]
)
-
setdefaults(
:rails,
:dblocation => { :default => "$statedir/clientconfigs.sqlite3",
@@ -678,18 +676,16 @@ module Puppet
},
:rails_loglevel => ["info", "The log level for Rails connections. The value must be
- a valid log level within Rails. Production environments normally use ``info``
- and other environments normally use ``debug``."]
+ a valid log level within Rails. Production environments normally use `info`
+ and other environments normally use `debug`."]
)
-
setdefaults(
:couchdb,
:couchdb_url => ["http://127.0.0.1:5984/puppet", "The url where the puppet couchdb database will be created"]
)
-
setdefaults(
:transaction,
:tags => ["", "Tags to use to find resources. If this is set, then
@@ -704,21 +700,19 @@ module Puppet
]
)
-
setdefaults(
:main,
:external_nodes => ["none",
"An external command that can produce node information. The output
must be a YAML dump of a hash, and that hash must have one or both of
- ``classes`` and ``parameters``, where ``classes`` is an array and
- ``parameters`` is a hash. For unknown nodes, the commands should
+ `classes` and `parameters`, where `classes` is an array and
+ `parameters` is a hash. For unknown nodes, the commands should
exit with a non-zero exit code.
This command makes it straightforward to store your node mapping
information in other data sources like databases."])
-
setdefaults(
:ldap,
:ldapnodes => [false,
@@ -733,9 +727,9 @@ module Puppet
Defaults to false because TLS usually requires certificates
to be set up on the client side."],
:ldapserver => ["ldap",
- "The LDAP server. Only used if ``ldapnodes`` is enabled."],
+ "The LDAP server. Only used if `ldapnodes` is enabled."],
:ldapport => [389,
- "The LDAP port. Only used if ``ldapnodes`` is enabled."],
+ "The LDAP port. Only used if `ldapnodes` is enabled."],
:ldapstring => ["(&(objectclass=puppetClient)(cn=%s))",
"The search string used to find an LDAP node."],
diff --git a/lib/puppet/indirector/facts/memory.rb b/lib/puppet/indirector/facts/memory.rb
index c4ca19da5..93682f456 100644
--- a/lib/puppet/indirector/facts/memory.rb
+++ b/lib/puppet/indirector/facts/memory.rb
@@ -3,7 +3,7 @@ require 'puppet/indirector/memory'
class Puppet::Node::Facts::Memory < Puppet::Indirector::Memory
desc "Keep track of facts in memory but nowhere else. This is used for
- one-time compiles, such as what the stand-alone ``puppet`` does.
+ one-time compiles, such as what the stand-alone `puppet` does.
To use this terminus, you must load it with the data you want it
to contain."
end
diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb
index b9fe35575..ecebc8279 100644
--- a/lib/puppet/indirector/node/ldap.rb
+++ b/lib/puppet/indirector/node/ldap.rb
@@ -19,30 +19,10 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
# LAK:NOTE Unfortunately, the ldap support is too stupid to throw anything
# but LDAP::ResultError, even on bad connections, so we are rough handed
# with our error handling.
- def name2hash(name,name_env,node_type)
+ def name2hash(name)
info = nil
- ldapsearch(search_filter(name)) {
- |entry| info = entry2hash(entry)
- if info[:environment]
- if name_env == info[:environment]
- return info
- else
- info = nil
- end
- else
- info_env = "production"
- if name_env == info[:environment]
- return info
- else
- info = nil
- end
- end
- }
- if node_type == 'parent'
- raise Puppet::Error.new("Could not find node '#{name}' with environment '#{name_env}'")
- end
-
- info = name2hash('default',name_env,'parent')
+ ldapsearch(search_filter(name)) { |entry| info = entry2hash(entry) }
+ info
end
# Look for our node in ldap.
@@ -53,18 +33,9 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
node = nil
names.each do |name|
- facts = Puppet::Node::Facts.find(name)
- if facts.values["environment"]
- name_env = facts.values["environment"]
- else
- name_env = "production"
- end
- info = name2hash(name,name_env,'child')
- next if info == nil
-
- if info
- break if node = info2node(request.key, info)
- end
+ next unless info = name2hash(name)
+
+ break if node = info2node(request.key, info)
end
node
@@ -200,29 +171,14 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
# Find information for our parent and merge it into the current info.
def find_and_merge_parent(parent, information)
-
- if information[:environment]
- name_env = information[:environment]
- else
- name_env = 'production'
- end
-
- parent_info = name2hash(parent,name_env,'parent')
- if parent_info
+ parent_info = name2hash(parent) || raise(Puppet::Error.new("Could not find parent node '#{parent}'"))
information[:classes] += parent_info[:classes]
parent_info[:parameters].each do |param, value|
- # Specifically test for whether it's set, so false values are handled
- # correctly.
+ # Specifically test for whether it's set, so false values are handled correctly.
information[:parameters][param] = value unless information[:parameters].include?(param)
end
-
information[:environment] ||= parent_info[:environment]
parent_info[:parent]
- else
- raise Puppet::Error.new("Could not find parent node '#{parent}'")
- nil
- end
-
end
# Take a name and a hash, and return a node instance.
diff --git a/lib/puppet/indirector/node/memory.rb b/lib/puppet/indirector/node/memory.rb
index ce4a52a8f..029926af8 100644
--- a/lib/puppet/indirector/node/memory.rb
+++ b/lib/puppet/indirector/node/memory.rb
@@ -3,7 +3,7 @@ require 'puppet/indirector/memory'
class Puppet::Node::Memory < Puppet::Indirector::Memory
desc "Keep track of nodes in memory but nowhere else. This is used for
- one-time compiles, such as what the stand-alone ``puppet`` does.
+ one-time compiles, such as what the stand-alone `puppet` does.
To use this terminus, you must load it with the data you want it
to contain; it is only useful for developers and should generally not
be chosen by a normal user."
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index 03d24b3fe..61ae2d2fc 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -117,7 +117,7 @@ module Puppet::Network::HTTP::Handler
result = indirection_request.model.search(indirection_request.key, indirection_request.to_hash)
if result.nil? or (result.is_a?(Array) and result.empty?)
- return do_exception(response, "Could not find instances in #{indirection_request.indirection_name} with '#{indirection_request.to_hash.inspect}'", 404)
+ return do_exception(response, "Could not find instances in #{indirection_request.indirection_name} with '#{indirection_request.key}'", 404)
end
format = format_to_use(request)
diff --git a/lib/puppet/network/http/rack/rest.rb b/lib/puppet/network/http/rack/rest.rb
index e5f50c465..b7e1d9709 100644
--- a/lib/puppet/network/http/rack/rest.rb
+++ b/lib/puppet/network/http/rack/rest.rb
@@ -41,7 +41,7 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler
unless result.is_a?(File)
response.write result
else
- response["Content-Length"] = result.stat.size
+ response["Content-Length"] = result.stat.size.to_s
response.body = RackFile.new(result)
end
end
diff --git a/lib/puppet/parameter/value_collection.rb b/lib/puppet/parameter/value_collection.rb
index a9fd20233..619e0731d 100644
--- a/lib/puppet/parameter/value_collection.rb
+++ b/lib/puppet/parameter/value_collection.rb
@@ -21,14 +21,14 @@ class Puppet::Parameter::ValueCollection
@doc += " Valid values are "
@doc += @strings.collect do |value|
if aliases = value.aliases and ! aliases.empty?
- "``#{value.name}`` (also called ``#{aliases.join(", ")}``)"
+ "`#{value.name}` (also called `#{aliases.join(", ")}`)"
else
- "``#{value.name}``"
+ "`#{value.name}`"
end
end.join(", ") + "."
end
- @doc += " Values can match ``" + regexes.join("``, ``") + "``." unless regexes.empty?
+ @doc += " Values can match `" + regexes.join("`, `") + "`." unless regexes.empty?
end
@doc
diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb
index 602016c75..74023f631 100644
--- a/lib/puppet/parser/ast/function.rb
+++ b/lib/puppet/parser/ast/function.rb
@@ -11,7 +11,6 @@ class Puppet::Parser::AST
@settor = true
def evaluate(scope)
-
# Make sure it's a defined function
raise Puppet::ParseError, "Unknown function #{@name}" unless Puppet::Parser::Functions.function(@name)
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb
index 49cde63ca..090d75c4e 100644
--- a/lib/puppet/parser/ast/leaf.rb
+++ b/lib/puppet/parser/ast/leaf.rb
@@ -42,7 +42,7 @@ class Puppet::Parser::AST
# The base string class.
class String < AST::Leaf
def evaluate(scope)
- @value
+ @value.dup
end
def to_s
diff --git a/lib/puppet/parser/ast/resource.rb b/lib/puppet/parser/ast/resource.rb
index 1b063c984..0c58538d5 100644
--- a/lib/puppet/parser/ast/resource.rb
+++ b/lib/puppet/parser/ast/resource.rb
@@ -33,11 +33,12 @@ class Resource < AST::ResourceReference
# This is where our implicit iteration takes place; if someone
# passed an array as the name, then we act just like the called us
# many times.
+ fully_qualified_type, resource_titles = scope.resolve_type_and_titles(type, resource_titles)
+
resource_titles.flatten.collect { |resource_title|
exceptwrap :type => Puppet::ParseError do
-
- resource = Puppet::Parser::Resource.new(
- type, resource_title,
+ resource = Puppet::Parser::Resource.new(
+ fully_qualified_type, resource_title,
:parameters => paramobjects,
:file => self.file,
:line => self.line,
diff --git a/lib/puppet/parser/ast/resource_reference.rb b/lib/puppet/parser/ast/resource_reference.rb
index 5d8334335..0f8e655bf 100644
--- a/lib/puppet/parser/ast/resource_reference.rb
+++ b/lib/puppet/parser/ast/resource_reference.rb
@@ -7,8 +7,15 @@ class Puppet::Parser::AST::ResourceReference < Puppet::Parser::AST::Branch
# Evaluate our object, but just return a simple array of the type
# and name.
def evaluate(scope)
- titles = Array(title.safeevaluate(scope)).collect { |t| Puppet::Resource.new(type, t, :namespaces => scope.namespaces) }
- return(titles.length == 1 ? titles.pop : titles)
+ titles = Array(title.safeevaluate(scope))
+
+ a_type, titles = scope.resolve_type_and_titles(type, titles)
+
+ resources = titles.collect{ |a_title|
+ Puppet::Resource.new(a_type, a_title)
+ }
+
+ return(resources.length == 1 ? resources.pop : resources)
end
def to_s
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb
index 61bb13cb6..98cad952c 100644
--- a/lib/puppet/parser/compiler.rb
+++ b/lib/puppet/parser/compiler.rb
@@ -23,6 +23,7 @@ class Puppet::Parser::Compiler
# We get these from the environment and only cache them in a thread
# variable for the duration of the compilation.
Thread.current[:known_resource_types] = nil
+ Thread.current[:env_module_directories] = nil
end
attr_reader :node, :facts, :collections, :catalog, :node_scope, :resources, :relationships
diff --git a/lib/puppet/parser/files.rb b/lib/puppet/parser/files.rb
index 9ef05e102..f34683153 100644
--- a/lib/puppet/parser/files.rb
+++ b/lib/puppet/parser/files.rb
@@ -24,7 +24,7 @@ module Puppet::Parser::Files
# Than that would be a "no."
end
abspat = File::expand_path(start, cwd)
- [nil, Dir.glob(abspat + (File.extname(abspat).empty? ? '{,.pp,.rb}' : '' )).uniq.reject { |f| FileTest.directory?(f) }]
+ [nil, Dir.glob(abspat + (File.extname(abspat).empty? ? '{.pp,.rb}' : '' )).uniq.reject { |f| FileTest.directory?(f) }]
end
# Find the concrete file denoted by +file+. If +file+ is absolute,
diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb
index c238da5d4..b0deac5bc 100644
--- a/lib/puppet/parser/functions.rb
+++ b/lib/puppet/parser/functions.rb
@@ -20,7 +20,7 @@ module Puppet::Parser::Functions
@autoloader = Puppet::Util::Autoload.new(
self,
"puppet/parser/functions",
-
+
:wrap => false
)
end
@@ -94,7 +94,7 @@ module Puppet::Parser::Functions
ret += "Undocumented.\n"
end
- ret += "\n\n- **Type**: #{hash[:type]}\n\n"
+ ret += "\n\n- *Type*: #{hash[:type]}\n\n"
end
ret
diff --git a/lib/puppet/parser/functions/defined.rb b/lib/puppet/parser/functions/defined.rb
index 2930a65cc..90632af2f 100644
--- a/lib/puppet/parser/functions/defined.rb
+++ b/lib/puppet/parser/functions/defined.rb
@@ -3,7 +3,7 @@ Puppet::Parser::Functions::newfunction(:defined, :type => :rvalue, :doc => "Dete
type is defined, either as a native type or a defined type, or whether a class is defined.
This is useful for checking whether a class is defined and only including it if it is.
This function can also test whether a resource has been defined, using resource references
- (e.g., ``if defined(File['/tmp/myfile']) { ... }``). This function is unfortunately
+ (e.g., `if defined(File['/tmp/myfile']) { ... }`). This function is unfortunately
dependent on the parse order of the configuration when testing whether a resource is defined.") do |vals|
result = false
vals = [vals] unless vals.is_a?(Array)
diff --git a/lib/puppet/parser/functions/extlookup.rb b/lib/puppet/parser/functions/extlookup.rb
index ee230e7ce..a4786f5da 100644
--- a/lib/puppet/parser/functions/extlookup.rb
+++ b/lib/puppet/parser/functions/extlookup.rb
@@ -99,19 +99,15 @@ module Puppet::Parser::Functions
# this will result in /path/to/extdata/hosts/your.box.com.csv
# being searched.
#
- # we parse the precedence here because the best place to specify
- # it would be in site.pp but site.pp is only evaluated at startup
- # so $fqdn etc would have no meaning there, this way it gets evaluated
- # each run and has access to the right variables for that run
- lookupvar('extlookup_precedence').each do |prec|
- while prec =~ /%\{(.+?)\}/
- prec.gsub!(/%\{#{$1}\}/, lookupvar($1))
+ # This is for back compatibility to interpolate variables with %.
+ # % interpolation is a workaround for a problem that has been fixed: Puppet variable
+ # interpolation at top scope used to only happen on each run
+ extlookup_precedence = lookupvar('extlookup_precedence').collect do |var|
+ var.gsub(/%\{(.+?)\}/) do |capture|
+ lookupvar($1)
end
-
- extlookup_precedence << prec
end
-
datafiles = Array.new
# if we got a custom data file, put it first in the array of search files
@@ -126,9 +122,6 @@ module Puppet::Parser::Functions
desired = nil
datafiles.each do |file|
- parser = Puppet::Parser::Parser.new(environment)
- parser.watch_file(file) if File.exists?(file)
-
if desired.nil?
if File.exists?(file)
result = CSV.read(file).find_all do |r|
diff --git a/lib/puppet/parser/functions/file.rb b/lib/puppet/parser/functions/file.rb
index 963111260..19ab9ba2e 100644
--- a/lib/puppet/parser/functions/file.rb
+++ b/lib/puppet/parser/functions/file.rb
@@ -2,7 +2,7 @@
Puppet::Parser::Functions::newfunction(
:file, :type => :rvalue,
-
+
:doc => "Return the contents of a file. Multiple files
can be passed, and the first file that exists will be read in.") do |vals|
ret = nil
diff --git a/lib/puppet/parser/functions/inline_template.rb b/lib/puppet/parser/functions/inline_template.rb
index 46e000383..9759ff6e1 100644
--- a/lib/puppet/parser/functions/inline_template.rb
+++ b/lib/puppet/parser/functions/inline_template.rb
@@ -1,9 +1,10 @@
Puppet::Parser::Functions::newfunction(:inline_template, :type => :rvalue, :doc =>
- "Evaluate a template string and return its value. See `the templating docs
- <http://docs.puppetlabs.com/guides/templating.html>`_ for more information. Note that
- if multiple template strings are specified, their output is all concatenated
- and returned as the output of the function.") do |vals|
- require 'erb'
+ "Evaluate a template string and return its value. See
+ [the templating docs](http://docs.puppetlabs.com/guides/templating.html) for
+ more information. Note that if multiple template strings are specified, their
+ output is all concatenated and returned as the output of the function.") do |vals|
+
+ require 'erb'
vals.collect do |string|
# Use a wrapper, so the template can't get access to the full
diff --git a/lib/puppet/parser/functions/md5.rb b/lib/puppet/parser/functions/md5.rb
new file mode 100644
index 000000000..f7a4f7222
--- /dev/null
+++ b/lib/puppet/parser/functions/md5.rb
@@ -0,0 +1,5 @@
+Puppet::Parser::Functions::newfunction(:md5, :type => :rvalue, :doc => "Returns a MD5 hash value from a provided string.") do |args|
+ require 'md5'
+
+ Digest::MD5.hexdigest(args[0])
+end
diff --git a/lib/puppet/parser/functions/realize.rb b/lib/puppet/parser/functions/realize.rb
index 4247b8af8..c21ccd14a 100644
--- a/lib/puppet/parser/functions/realize.rb
+++ b/lib/puppet/parser/functions/realize.rb
@@ -5,7 +5,7 @@ Puppet::Parser::Functions::newfunction(:realize, :doc => "Make a virtual object
when you want to know the name of the virtual object and don't want to
bother with a full collection. It is slightly faster than a collection,
and, of course, is a bit shorter. You must pass the object using a
- reference; e.g.: ``realize User[luke]``." ) do |vals|
+ reference; e.g.: `realize User[luke]`." ) do |vals|
coll = Puppet::Parser::Collector.new(self, :nomatter, nil, nil, :virtual)
vals = [vals] unless vals.is_a?(Array)
coll.resources = vals.flatten
diff --git a/lib/puppet/parser/functions/regsubst.rb b/lib/puppet/parser/functions/regsubst.rb
index c0aeef222..f655db7b3 100644
--- a/lib/puppet/parser/functions/regsubst.rb
+++ b/lib/puppet/parser/functions/regsubst.rb
@@ -6,37 +6,37 @@ module Puppet::Parser::Functions
:doc => "
Perform regexp replacement on a string or array of strings.
-- **Parameters** (in order):
+* *Parameters* (in order):
-:target: The string or array of strings to operate on. If an array, the replacement will be performed on each of the elements in the array, and the return value will be an array.
+ _target_ The string or array of strings to operate on. If an array, the replacement will be performed on each of the elements in the array, and the return value will be an array.
-:regexp: The regular expression matching the target string. If you want it anchored at the start and or end of the string, you must do that with ^ and $ yourself.
+ _regexp_ The regular expression matching the target string. If you want it anchored at the start and or end of the string, you must do that with ^ and $ yourself.
-:replacement: Replacement string. Can contain back references to what was matched using \\0, \\1, and so on.
+ _replacement_ Replacement string. Can contain back references to what was matched using \\0, \\1, and so on.
-:flags: Optional. String of single letter flags for how the regexp is interpreted:
+ _flags_ Optional. String of single letter flags for how the regexp is interpreted:
- - **E** Extended regexps
- - **I** Ignore case in regexps
- - **M** Multiline regexps
- - **G** Global replacement; all occurrences of the regexp in each target string will be replaced. Without this, only the first occurrence will be replaced.
+ - *E* Extended regexps
+ - *I* Ignore case in regexps
+ - *M* Multiline regexps
+ - *G* Global replacement; all occurrences of the regexp in each target string will be replaced. Without this, only the first occurrence will be replaced.
-:lang: Optional. How to handle multibyte characters. A single-character string with the following values:
+ _lang_ Optional. How to handle multibyte characters. A single-character string with the following values:
- - **N** None
- - **E** EUC
- - **S** SJIS
- - **U** UTF-8
+ - *N* None
+ - *E* EUC
+ - *S* SJIS
+ - *U* UTF-8
-- **Examples**
+* *Examples*
-Get the third octet from the node's IP address::
+Get the third octet from the node's IP address:
- $i3 = regsubst($ipaddress,'^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)$','\\3')
+ $i3 = regsubst($ipaddress,'^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)$','\\3')
-Put angle brackets around each octet in the node's IP address::
+Put angle brackets around each octet in the node's IP address:
- $x = regsubst($ipaddress, '([0-9]+)', '<\\1>', 'G')
+ $x = regsubst($ipaddress, '([0-9]+)', '<\\1>', 'G')
") \
do |args|
unless args.length.between?(3, 5)
diff --git a/lib/puppet/parser/functions/require.rb b/lib/puppet/parser/functions/require.rb
index 3f98c9523..f15046b91 100644
--- a/lib/puppet/parser/functions/require.rb
+++ b/lib/puppet/parser/functions/require.rb
@@ -12,9 +12,8 @@ relationships between classes. This function is a superset of the
class depends on the required class.
Warning: using require in place of include can lead to unwanted dependency cycles.
- For instance the following manifest, with 'require' instead of 'include'
- would produce a nasty dependence cycle, because notify imposes a before
- between File[/foo] and Service[foo]::
+
+For instance the following manifest, with 'require' instead of 'include' would produce a nasty dependence cycle, because notify imposes a before between File[/foo] and Service[foo]:
class myservice {
service { foo: ensure => running }
diff --git a/lib/puppet/parser/functions/split.rb b/lib/puppet/parser/functions/split.rb
index 5d0a9dabc..52394095a 100644
--- a/lib/puppet/parser/functions/split.rb
+++ b/lib/puppet/parser/functions/split.rb
@@ -6,7 +6,7 @@ module Puppet::Parser::Functions
:doc => "\
Split a string variable into an array using the specified split regexp.
- Usage::
+ Usage:
$string = 'v1.v2:v3.v4'
$array_var1 = split($string, ':')
diff --git a/lib/puppet/parser/functions/sprintf.rb b/lib/puppet/parser/functions/sprintf.rb
index 5ada0fed7..5eb4a4f9d 100644
--- a/lib/puppet/parser/functions/sprintf.rb
+++ b/lib/puppet/parser/functions/sprintf.rb
@@ -5,7 +5,7 @@ module Puppet::Parser::Functions
:doc => "Perform printf-style formatting of text.
- The first parameter is format string describing how the rest of the parameters should be formatted. See the documentation for the ``Kernel::sprintf`` function in Ruby for all the details.") do |args|
+ The first parameter is format string describing how the rest of the parameters should be formatted. See the documentation for the `Kernel::sprintf` function in Ruby for all the details.") do |args|
raise Puppet::ParseError, 'sprintf() needs at least one argument' if args.length < 1
fmt = args.shift
return sprintf(fmt, *args)
diff --git a/lib/puppet/parser/functions/template.rb b/lib/puppet/parser/functions/template.rb
index f51bcc1e2..6fa110332 100644
--- a/lib/puppet/parser/functions/template.rb
+++ b/lib/puppet/parser/functions/template.rb
@@ -1,6 +1,8 @@
Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :doc =>
- "Evaluate a template and return its value. See `the templating docs
- <http://docs.puppetlabs.com/guides/templating.html>`_ for more information.
+ "Evaluate a template and return its value. See
+ [the templating docs](http://docs.puppetlabs.com/guides/templating.html) for
+ more information.
+
Note that if multiple templates are specified, their output is all
concatenated and returned as the output of the function.") do |vals|
require 'erb'
diff --git a/lib/puppet/parser/functions/versioncmp.rb b/lib/puppet/parser/functions/versioncmp.rb
index b38406532..94ba3886f 100644
--- a/lib/puppet/parser/functions/versioncmp.rb
+++ b/lib/puppet/parser/functions/versioncmp.rb
@@ -3,26 +3,26 @@ require 'puppet/util/package'
Puppet::Parser::Functions::newfunction(
:versioncmp, :type => :rvalue,
-
+
:doc => "Compares two versions
-Prototype::
+Prototype:
- \$result = versioncmp(a, b)
+ \$result = versioncmp(a, b)
- where a and b are arbitrary version strings
+Where a and b are arbitrary version strings
-This functions returns a number::
+This functions returns a number:
- * > 0 if version a is greater than version b
- * == 0 if both version are equals
- * < 0 if version a is less than version b
+* > 0 if version a is greater than version b
+* == 0 if both version are equals
+* < 0 if version a is less than version b
-Example::
+Example:
- if versioncmp('2.6-1', '2.4.5') > 0 {
- notice('2.6-1 is > than 2.4.5')
- }
+ if versioncmp('2.6-1', '2.4.5') > 0 {
+ notice('2.6-1 is > than 2.4.5')
+ }
") do |args|
diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb
index aa04f17a0..a25a17e3f 100644
--- a/lib/puppet/parser/lexer.rb
+++ b/lib/puppet/parser/lexer.rb
@@ -221,7 +221,7 @@ class Puppet::Parser::Lexer
TOKENS.add_token :RETURN, "\n", :skip => true, :incr_line => true, :skip_text => true
TOKENS.add_token :SQUOTE, "'" do |lexer, value|
- [TOKENS[:STRING], lexer.slurpstring(value,["'"],:ignore_invalid_esapes).first ]
+ [TOKENS[:STRING], lexer.slurpstring(value,["'"],:ignore_invalid_escapes).first ]
end
DQ_initial_token_types = {'$' => :DQPRE,'"' => :STRING}
@@ -483,7 +483,7 @@ class Puppet::Parser::Lexer
yield [final_token.name, token_value]
if @previous_token
- namestack(value) if @previous_token.name == :CLASS
+ namestack(value) if @previous_token.name == :CLASS and value != '{'
if @previous_token.name == :DEFINE
if indefine?
@@ -523,17 +523,17 @@ class Puppet::Parser::Lexer
str = @scanner.scan_until(/([^\\]|^)[#{terminators}]/) or lex_error "Unclosed quote after '#{last}' in '#{rest}'"
@line += str.count("\n") # literal carriage returns add to the line count.
str.gsub!(/\\(.)/) {
- case ch=$1
- when 'n'; "\n"
- when 't'; "\t"
- when 's'; " "
- else
- if escapes.include? ch
- ch
- else
- Puppet.warning "Unrecognised escape sequence '\\#{ch}'#{file && " in file #{file}"}#{line && " at line #{line}"}" unless ignore_invalid_escapes
- "\\#{ch}"
+ ch = $1
+ if escapes.include? ch
+ case ch
+ when 'n'; "\n"
+ when 't'; "\t"
+ when 's'; " "
+ else ch
end
+ else
+ Puppet.warning "Unrecognised escape sequence '\\#{ch}'#{file && " in file #{file}"}#{line && " at line #{line}"}" unless ignore_invalid_escapes
+ "\\#{ch}"
end
}
[ str[0..-2],str[-1,1] ]
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index 3c451929e..8a5ae886c 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -102,9 +102,9 @@ class Puppet::Parser::Resource < Puppet::Resource
end
def initialize(*args)
+ raise ArgumentError, "Resources require a scope" unless args.last[:scope]
super
- raise ArgumentError, "Resources require a scope" unless scope
@source ||= scope.source
end
@@ -140,10 +140,6 @@ class Puppet::Parser::Resource < Puppet::Resource
self[:name] || self.title
end
- def namespaces
- scope.namespaces
- end
-
# A temporary occasion, until I get paths in the scopes figured out.
def path
to_s
diff --git a/lib/puppet/parser/resource/param.rb b/lib/puppet/parser/resource/param.rb
index af2d98fe8..c28322337 100644
--- a/lib/puppet/parser/resource/param.rb
+++ b/lib/puppet/parser/resource/param.rb
@@ -13,7 +13,7 @@ class Puppet::Parser::Resource::Param
def initialize(hash)
set_options(hash)
- requiredopts(:name, :value, :source)
+ requiredopts(:name, :value)
@name = symbolize(@name)
end
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index ae0f9ea4a..24f1d01f7 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -474,6 +474,41 @@ class Puppet::Parser::Scope
end
end
+ def find_resource_type(type)
+ # It still works fine without the type == 'class' short-cut, but it is a lot slower.
+ return nil if ["class", "node"].include? type.to_s.downcase
+ find_builtin_resource_type(type) || find_defined_resource_type(type)
+ end
+
+ def find_builtin_resource_type(type)
+ Puppet::Type.type(type.to_s.downcase.to_sym)
+ end
+
+ def find_defined_resource_type(type)
+ environment.known_resource_types.find_definition(namespaces, type.to_s.downcase)
+ end
+
+ def resolve_type_and_titles(type, titles)
+ raise ArgumentError, "titles must be an array" unless titles.is_a?(Array)
+
+ case type.downcase
+ when "class"
+ # resolve the titles
+ titles = titles.collect do |a_title|
+ hostclass = find_hostclass(a_title)
+ hostclass ? hostclass.name : a_title
+ end
+ when "node"
+ # no-op
+ else
+ # resolve the type
+ resource_type = find_resource_type(type)
+ type = resource_type.name if resource_type
+ end
+
+ return [type, titles]
+ end
+
private
def extend_with_functions_module
diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb
index 282a52cf4..84e1a0360 100644
--- a/lib/puppet/property.rb
+++ b/lib/puppet/property.rb
@@ -55,10 +55,10 @@ class Puppet::Property < Puppet::Parameter
# * <tt>:required_features</tt>: A list of features this value requires.
# * <tt>:event</tt>: The event that should be returned when this value is set.
# * <tt>:call</tt>: When to call any associated block. The default value
- # is ``instead``, which means to call the value instead of calling the
- # provider. You can also specify ``before`` or ``after``, which will
+ # is `instead`, which means to call the value instead of calling the
+ # provider. You can also specify `before` or `after`, which will
# call both the block and the provider, according to the order you specify
- # (the ``first`` refers to when the block is called, not the provider).
+ # (the `first` refers to when the block is called, not the provider).
def self.newvalue(name, options = {}, &block)
value = value_collection.newvalue(name, options, &block)
@@ -181,10 +181,10 @@ class Puppet::Property < Puppet::Parameter
def log(msg)
Puppet::Util::Log.create(
-
+
:level => resource[:loglevel],
:message => msg,
-
+
:source => self
)
end
diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb
index 8f993dbc1..af792b623 100644
--- a/lib/puppet/provider.rb
+++ b/lib/puppet/provider.rb
@@ -205,7 +205,7 @@ class Puppet::Provider
dochook(:defaults) do
if @defaults.length > 0
return " Default for " + @defaults.collect do |f, v|
- "``#{f}`` == ``#{v}``"
+ "`#{f}` == `#{v}`"
end.join(" and ") + "."
end
end
@@ -213,7 +213,7 @@ class Puppet::Provider
dochook(:commands) do
if @commands.length > 0
return " Required binaries: " + @commands.collect do |n, c|
- "``#{c}``"
+ "`#{c}`"
end.join(", ") + "."
end
end
@@ -221,7 +221,7 @@ class Puppet::Provider
dochook(:features) do
if features.length > 0
return " Supported features: " + features.collect do |f|
- "``#{f}``"
+ "`#{f}`"
end.join(", ") + "."
end
end
diff --git a/lib/puppet/provider/group/groupadd.rb b/lib/puppet/provider/group/groupadd.rb
index e661ddd7f..82ed4c0c7 100644
--- a/lib/puppet/provider/group/groupadd.rb
+++ b/lib/puppet/provider/group/groupadd.rb
@@ -1,7 +1,7 @@
require 'puppet/provider/nameservice/objectadd'
Puppet::Type.type(:group).provide :groupadd, :parent => Puppet::Provider::NameService::ObjectAdd do
- desc "Group management via ``groupadd`` and its ilk.
+ desc "Group management via `groupadd` and its ilk.
The default for most platforms
diff --git a/lib/puppet/provider/group/ldap.rb b/lib/puppet/provider/group/ldap.rb
index 2737feea6..86c72a5d3 100644
--- a/lib/puppet/provider/group/ldap.rb
+++ b/lib/puppet/provider/group/ldap.rb
@@ -1,11 +1,11 @@
require 'puppet/provider/ldap'
Puppet::Type.type(:group).provide :ldap, :parent => Puppet::Provider::Ldap do
- desc "Group management via ``ldap``.
+ desc "Group management via `ldap`.
This provider requires that you have valid values for all of the
- ldap-related settings, including ``ldapbase``. You will also almost
- definitely need settings for ``ldapuser`` and ``ldappassword``, so that
+ ldap-related settings, including `ldapbase`. You will also almost
+ definitely need settings for `ldapuser` and `ldappassword`, so that
your clients can write to ldap.
Note that this provider will automatically generate a GID for you if you do
diff --git a/lib/puppet/provider/group/pw.rb b/lib/puppet/provider/group/pw.rb
index e3dd714ee..a054d1ff1 100644
--- a/lib/puppet/provider/group/pw.rb
+++ b/lib/puppet/provider/group/pw.rb
@@ -1,7 +1,7 @@
require 'puppet/provider/nameservice/pw'
Puppet::Type.type(:group).provide :pw, :parent => Puppet::Provider::NameService::PW do
- desc "Group management via ``pw``.
+ desc "Group management via `pw`.
Only works on FreeBSD.
diff --git a/lib/puppet/provider/package/apple.rb b/lib/puppet/provider/package/apple.rb
index 0946de47f..b5bb9102f 100755
--- a/lib/puppet/provider/package/apple.rb
+++ b/lib/puppet/provider/package/apple.rb
@@ -5,7 +5,7 @@ Puppet::Type.type(:package).provide :apple, :parent => Puppet::Provider::Package
desc "Package management based on OS X's builtin packaging system. This is
essentially the simplest and least functional package system in existence --
it only supports installation; no deletion or upgrades. The provider will
- automatically add the ``.pkg`` extension, so leave that off when specifying
+ automatically add the `.pkg` extension, so leave that off when specifying
the package name."
confine :operatingsystem => :darwin
diff --git a/lib/puppet/provider/package/apt.rb b/lib/puppet/provider/package/apt.rb
index d055e7552..b6ded39fd 100755
--- a/lib/puppet/provider/package/apt.rb
+++ b/lib/puppet/provider/package/apt.rb
@@ -2,7 +2,7 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
# Provide sorting functionality
include Puppet::Util::Package
- desc "Package management via ``apt-get``."
+ desc "Package management via `apt-get`."
has_feature :versionable
diff --git a/lib/puppet/provider/package/aptitude.rb b/lib/puppet/provider/package/aptitude.rb
index 557e657a4..8bdf984e6 100755
--- a/lib/puppet/provider/package/aptitude.rb
+++ b/lib/puppet/provider/package/aptitude.rb
@@ -1,5 +1,5 @@
Puppet::Type.type(:package).provide :aptitude, :parent => :apt, :source => :dpkg do
- desc "Package management via ``aptitude``."
+ desc "Package management via `aptitude`."
has_feature :versionable
diff --git a/lib/puppet/provider/package/aptrpm.rb b/lib/puppet/provider/package/aptrpm.rb
index d7842089f..2eb33c72b 100644
--- a/lib/puppet/provider/package/aptrpm.rb
+++ b/lib/puppet/provider/package/aptrpm.rb
@@ -2,7 +2,7 @@ Puppet::Type.type(:package).provide :aptrpm, :parent => :rpm, :source => :rpm do
# Provide sorting functionality
include Puppet::Util::Package
- desc "Package management via ``apt-get`` ported to ``rpm``."
+ desc "Package management via `apt-get` ported to `rpm`."
has_feature :versionable
diff --git a/lib/puppet/provider/package/blastwave.rb b/lib/puppet/provider/package/blastwave.rb
index 9f1f1ec19..e9c84845f 100755
--- a/lib/puppet/provider/package/blastwave.rb
+++ b/lib/puppet/provider/package/blastwave.rb
@@ -1,6 +1,6 @@
# Packaging using Blastwave's pkg-get program.
Puppet::Type.type(:package).provide :blastwave, :parent => :sun, :source => :sun do
- desc "Package management using Blastwave.org's ``pkg-get`` command on Solaris."
+ desc "Package management using Blastwave.org's `pkg-get` command on Solaris."
pkgget = "pkg-get"
pkgget = "/opt/csw/bin/pkg-get" if FileTest.executable?("/opt/csw/bin/pkg-get")
diff --git a/lib/puppet/provider/package/dpkg.rb b/lib/puppet/provider/package/dpkg.rb
index bee63bfba..7b34b09af 100755
--- a/lib/puppet/provider/package/dpkg.rb
+++ b/lib/puppet/provider/package/dpkg.rb
@@ -1,8 +1,8 @@
require 'puppet/provider/package'
Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package do
- desc "Package management via ``dpkg``. Because this only uses ``dpkg``
- and not ``apt``, you must specify the source of any packages you want
+ desc "Package management via `dpkg`. Because this only uses `dpkg`
+ and not `apt`, you must specify the source of any packages you want
to manage."
has_feature :holdable
diff --git a/lib/puppet/provider/package/fink.rb b/lib/puppet/provider/package/fink.rb
index 5cf47860e..db991397a 100755
--- a/lib/puppet/provider/package/fink.rb
+++ b/lib/puppet/provider/package/fink.rb
@@ -2,7 +2,7 @@ Puppet::Type.type(:package).provide :fink, :parent => :dpkg, :source => :dpkg do
# Provide sorting functionality
include Puppet::Util::Package
- desc "Package management via ``fink``."
+ desc "Package management via `fink`."
commands :fink => "/sw/bin/fink"
commands :aptget => "/sw/bin/apt-get"
diff --git a/lib/puppet/provider/package/gem.rb b/lib/puppet/provider/package/gem.rb
index 8d70b756f..19414cec4 100755
--- a/lib/puppet/provider/package/gem.rb
+++ b/lib/puppet/provider/package/gem.rb
@@ -3,7 +3,7 @@ require 'uri'
# Ruby gems support.
Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package do
- desc "Ruby Gem support. If a URL is passed via ``source``, then that URL is used as the
+ desc "Ruby Gem support. If a URL is passed via `source`, then that URL is used as the
remote gem repository; if a source is present but is not a valid URL, it will be
interpreted as the path to a local gem file. If source is not present at all,
the gem will be installed from the default gem repositories."
diff --git a/lib/puppet/provider/package/openbsd.rb b/lib/puppet/provider/package/openbsd.rb
index ca477e56a..22df14d62 100755
--- a/lib/puppet/provider/package/openbsd.rb
+++ b/lib/puppet/provider/package/openbsd.rb
@@ -3,7 +3,7 @@ require 'puppet/provider/package'
# Packaging on OpenBSD. Doesn't work anywhere else that I know of.
Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Package do
include Puppet::Util::Execution
- desc "OpenBSD's form of ``pkg_add`` support."
+ desc "OpenBSD's form of `pkg_add` support."
commands :pkginfo => "pkg_info", :pkgadd => "pkg_add", :pkgdelete => "pkg_delete"
diff --git a/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb
index d33a4f2f3..72dc260a4 100755
--- a/lib/puppet/provider/package/rpm.rb
+++ b/lib/puppet/provider/package/rpm.rb
@@ -1,7 +1,7 @@
require 'puppet/provider/package'
# RPM packaging. Should work anywhere that has rpm installed.
Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Provider::Package do
- desc "RPM packaging support; should work anywhere with a working ``rpm``
+ desc "RPM packaging support; should work anywhere with a working `rpm`
binary."
has_feature :versionable
diff --git a/lib/puppet/provider/package/rug.rb b/lib/puppet/provider/package/rug.rb
index 7028cc9e5..28729952d 100644
--- a/lib/puppet/provider/package/rug.rb
+++ b/lib/puppet/provider/package/rug.rb
@@ -1,5 +1,5 @@
Puppet::Type.type(:package).provide :rug, :parent => :rpm do
- desc "Support for suse ``rug`` package manager."
+ desc "Support for suse `rug` package manager."
has_feature :versionable
diff --git a/lib/puppet/provider/package/sunfreeware.rb b/lib/puppet/provider/package/sunfreeware.rb
index 53f03ed6e..4745ea1eb 100755
--- a/lib/puppet/provider/package/sunfreeware.rb
+++ b/lib/puppet/provider/package/sunfreeware.rb
@@ -1,7 +1,7 @@
# At this point, it's an exact copy of the Blastwave stuff.
Puppet::Type.type(:package).provide :sunfreeware, :parent => :blastwave, :source => :sun do
- desc "Package management using sunfreeware.com's ``pkg-get`` command on Solaris.
- At this point, support is exactly the same as ``blastwave`` support and
+ desc "Package management using sunfreeware.com's `pkg-get` command on Solaris.
+ At this point, support is exactly the same as `blastwave` support and
has not actually been tested."
commands :pkgget => "pkg-get"
diff --git a/lib/puppet/provider/package/up2date.rb b/lib/puppet/provider/package/up2date.rb
index 5ff32bedc..243bc6c6b 100644
--- a/lib/puppet/provider/package/up2date.rb
+++ b/lib/puppet/provider/package/up2date.rb
@@ -1,5 +1,5 @@
Puppet::Type.type(:package).provide :up2date, :parent => :rpm, :source => :rpm do
- desc "Support for Red Hat's proprietary ``up2date`` package update
+ desc "Support for Red Hat's proprietary `up2date` package update
mechanism."
commands :up2date => "/usr/sbin/up2date-nox"
diff --git a/lib/puppet/provider/package/urpmi.rb b/lib/puppet/provider/package/urpmi.rb
index 88a17ccb4..425d77849 100644
--- a/lib/puppet/provider/package/urpmi.rb
+++ b/lib/puppet/provider/package/urpmi.rb
@@ -1,5 +1,5 @@
Puppet::Type.type(:package).provide :urpmi, :parent => :rpm, :source => :rpm do
- desc "Support via ``urpmi``."
+ desc "Support via `urpmi`."
commands :urpmi => "urpmi", :urpmq => "urpmq", :rpm => "rpm"
if command('rpm')
diff --git a/lib/puppet/provider/package/yum.rb b/lib/puppet/provider/package/yum.rb
index 07f68ddb1..fcda5ba8c 100755
--- a/lib/puppet/provider/package/yum.rb
+++ b/lib/puppet/provider/package/yum.rb
@@ -1,5 +1,5 @@
Puppet::Type.type(:package).provide :yum, :parent => :rpm, :source => :rpm do
- desc "Support via ``yum``."
+ desc "Support via `yum`."
has_feature :versionable
diff --git a/lib/puppet/provider/package/zypper.rb b/lib/puppet/provider/package/zypper.rb
index d56c72549..f129ef6e6 100644
--- a/lib/puppet/provider/package/zypper.rb
+++ b/lib/puppet/provider/package/zypper.rb
@@ -1,5 +1,5 @@
Puppet::Type.type(:package).provide :zypper, :parent => :rpm do
- desc "Support for SuSE ``zypper`` package manager. Found in SLES10sp2+ and SLES11"
+ desc "Support for SuSE `zypper` package manager. Found in SLES10sp2+ and SLES11"
has_feature :versionable
diff --git a/lib/puppet/provider/service/base.rb b/lib/puppet/provider/service/base.rb
index 70d764187..211e7f964 100755
--- a/lib/puppet/provider/service/base.rb
+++ b/lib/puppet/provider/service/base.rb
@@ -5,7 +5,7 @@ Puppet::Type.type(:service).provide :base do
minimum you can specify is a binary for starting the process, and this
same binary will be searched for in the process table to stop the
service. It is preferable to specify start, stop, and status commands,
- akin to how you would do so using ``init``.
+ akin to how you would do so using `init`.
"
diff --git a/lib/puppet/provider/service/bsd.rb b/lib/puppet/provider/service/bsd.rb
index 2e00c33f1..e2a0e35f7 100644
--- a/lib/puppet/provider/service/bsd.rb
+++ b/lib/puppet/provider/service/bsd.rb
@@ -1,8 +1,8 @@
# Manage FreeBSD services.
Puppet::Type.type(:service).provide :bsd, :parent => :init do
- desc "FreeBSD's (and probably NetBSD?) form of ``init``-style service management.
+ desc "FreeBSD's (and probably NetBSD?) form of `init`-style service management.
- Uses ``rc.conf.d`` for service enabling and disabling.
+ Uses `rc.conf.d` for service enabling and disabling.
"
diff --git a/lib/puppet/provider/service/debian.rb b/lib/puppet/provider/service/debian.rb
index 4379f1b59..3d09e2849 100755
--- a/lib/puppet/provider/service/debian.rb
+++ b/lib/puppet/provider/service/debian.rb
@@ -1,10 +1,10 @@
# Manage debian services. Start/stop is the same as InitSvc, but enable/disable
# is special.
Puppet::Type.type(:service).provide :debian, :parent => :init do
- desc "Debian's form of ``init``-style management.
+ desc "Debian's form of `init`-style management.
The only difference is that this supports service enabling and disabling
- via ``update-rc.d`` and determines enabled status via ``invoke-rc.d``.
+ via `update-rc.d` and determines enabled status via `invoke-rc.d`.
"
diff --git a/lib/puppet/provider/service/gentoo.rb b/lib/puppet/provider/service/gentoo.rb
index 08250a06a..382c74267 100644
--- a/lib/puppet/provider/service/gentoo.rb
+++ b/lib/puppet/provider/service/gentoo.rb
@@ -1,9 +1,9 @@
# Manage gentoo services. Start/stop is the same as InitSvc, but enable/disable
# is special.
Puppet::Type.type(:service).provide :gentoo, :parent => :init do
- desc "Gentoo's form of ``init``-style service management.
+ desc "Gentoo's form of `init`-style service management.
- Uses ``rc-update`` for service enabling and disabling.
+ Uses `rc-update` for service enabling and disabling.
"
diff --git a/lib/puppet/provider/service/init.rb b/lib/puppet/provider/service/init.rb
index 6abff12db..447c01aa5 100755
--- a/lib/puppet/provider/service/init.rb
+++ b/lib/puppet/provider/service/init.rb
@@ -3,9 +3,9 @@
Puppet::Type.type(:service).provide :init, :parent => :base do
desc "Standard init service management.
- This provider assumes that the init script has no ``status`` command,
+ This provider assumes that the init script has no `status` command,
because so few scripts do, so you need to either provide a status
- command or specify via ``hasstatus`` that one already exists in the
+ command or specify via `hasstatus` that one already exists in the
init script.
"
diff --git a/lib/puppet/provider/service/redhat.rb b/lib/puppet/provider/service/redhat.rb
index 3ca67d66f..e851a488d 100755
--- a/lib/puppet/provider/service/redhat.rb
+++ b/lib/puppet/provider/service/redhat.rb
@@ -1,9 +1,9 @@
# Manage Red Hat services. Start/stop uses /sbin/service and enable/disable uses chkconfig
Puppet::Type.type(:service).provide :redhat, :parent => :init, :source => :init do
- desc "Red Hat's (and probably many others) form of ``init``-style service management:
+ desc "Red Hat's (and probably many others) form of `init`-style service management:
- Uses ``chkconfig`` for service enabling and disabling.
+ Uses `chkconfig` for service enabling and disabling.
"
diff --git a/lib/puppet/provider/user/ldap.rb b/lib/puppet/provider/user/ldap.rb
index df082c569..75a9667b3 100644
--- a/lib/puppet/provider/user/ldap.rb
+++ b/lib/puppet/provider/user/ldap.rb
@@ -1,10 +1,10 @@
require 'puppet/provider/ldap'
Puppet::Type.type(:user).provide :ldap, :parent => Puppet::Provider::Ldap do
- desc "User management via ``ldap``. This provider requires that you
+ desc "User management via `ldap`. This provider requires that you
have valid values for all of the ldap-related settings,
- including ``ldapbase``. You will also almost definitely need settings
- for ``ldapuser`` and ``ldappassword``, so that your clients can write
+ including `ldapbase`. You will also almost definitely need settings
+ for `ldapuser` and `ldappassword`, so that your clients can write
to ldap.
Note that this provider will automatically generate a UID for you if
diff --git a/lib/puppet/provider/user/pw.rb b/lib/puppet/provider/user/pw.rb
index 345d924bf..a5988cad1 100644
--- a/lib/puppet/provider/user/pw.rb
+++ b/lib/puppet/provider/user/pw.rb
@@ -1,7 +1,7 @@
require 'puppet/provider/nameservice/pw'
Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::PW do
- desc "User management via ``pw`` on FreeBSD."
+ desc "User management via `pw` on FreeBSD."
commands :pw => "pw"
has_features :manages_homedir, :allows_duplicates
diff --git a/lib/puppet/provider/user/user_role_add.rb b/lib/puppet/provider/user/user_role_add.rb
index ea1b01b3b..c13125925 100644
--- a/lib/puppet/provider/user/user_role_add.rb
+++ b/lib/puppet/provider/user/user_role_add.rb
@@ -2,7 +2,7 @@ require 'puppet/util/user_attr'
Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source => :useradd do
- desc "User management inherits ``useradd`` and adds logic to manage roles on Solaris using roleadd."
+ desc "User management inherits `useradd` and adds logic to manage roles on Solaris using roleadd."
defaultfor :operatingsystem => :solaris
diff --git a/lib/puppet/provider/user/useradd.rb b/lib/puppet/provider/user/useradd.rb
index ec87694d7..7ef217d9e 100644
--- a/lib/puppet/provider/user/useradd.rb
+++ b/lib/puppet/provider/user/useradd.rb
@@ -1,7 +1,7 @@
require 'puppet/provider/nameservice/objectadd'
Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameService::ObjectAdd do
- desc "User management via ``useradd`` and its ilk. Note that you will need to install the ``Shadow Password`` Ruby library often known as ruby-libshadow to manage user passwords."
+ desc "User management via `useradd` and its ilk. Note that you will need to install the `Shadow Password` Ruby library often known as ruby-libshadow to manage user passwords."
commands :add => "useradd", :delete => "userdel", :modify => "usermod"
diff --git a/lib/puppet/reference/configuration.rb b/lib/puppet/reference/configuration.rb
index bfa2cb802..fadd1a423 100644
--- a/lib/puppet/reference/configuration.rb
+++ b/lib/puppet/reference/configuration.rb
@@ -33,7 +33,7 @@ config = Puppet::Util::Reference.newreference(:configuration, :depth => 1, :doc
# Leave out the section information; it was apparently confusing people.
#str += "- **Section**: #{object.section}\n"
unless val == ""
- str += "- **Default**: #{val}\n"
+ str += "- *Default*: #{val}\n"
end
str += "\n"
end
@@ -47,7 +47,7 @@ Specifying Configuration Parameters
On The Command-Line
+++++++++++++++++++
-Every Puppet executable (with the exception of ``puppetdoc``) accepts all of
+Every Puppet executable (with the exception of `puppetdoc`) accepts all of
the parameters below, but not all of the arguments make sense for every executable.
I have tried to be as thorough as possible in the descriptions of the
@@ -55,60 +55,61 @@ arguments, so it should be obvious whether an argument is appropriate or not.
These parameters can be supplied to the executables either as command-line
options or in the configuration file. For instance, the command-line
-invocation below would set the configuration directory to ``/private/puppet``::
+invocation below would set the configuration directory to `/private/puppet`:
- $ puppet agent --confdir=/private/puppet
+ $ puppet agent --confdir=/private/puppet
Note that boolean options are turned on and off with a slightly different
-syntax on the command line::
+syntax on the command line:
- $ puppet agent --storeconfigs
+ $ puppet agent --storeconfigs
- $ puppet agent --no-storeconfigs
+ $ puppet agent --no-storeconfigs
The invocations above will enable and disable, respectively, the storage of
the client configuration.
Configuration Files
+++++++++++++++++++
+
As mentioned above, the configuration parameters can also be stored in a
configuration file, located in the configuration directory. As root, the
-default configuration directory is ``/etc/puppet``, and as a regular user, the
-default configuration directory is ``~user/.puppet``. As of 0.23.0, all
-executables look for ``puppet.conf`` in their configuration directory
+default configuration directory is `/etc/puppet`, and as a regular user, the
+default configuration directory is `~user/.puppet`. As of 0.23.0, all
+executables look for `puppet.conf` in their configuration directory
(although they previously looked for separate files). For example,
-``puppet.conf`` is located at ``/etc/puppet/puppet.conf`` as root and
-``~user/.puppet/puppet.conf`` as a regular user by default.
+`puppet.conf` is located at `/etc/puppet/puppet.conf` as `root` and
+`~user/.puppet/puppet.conf` as a regular user by default.
-All executables will set any parameters set within the ``main`` section,
-and each executable will also use one of the ``master``, ``agent``, or
-``user`` sections.
+All executables will set any parameters set within the `[main]` section,
+and each executable will also use one of the `[master]`, `[agent]`.
File Format
'''''''''''
+
The file follows INI-style formatting. Here is an example of a very simple
-``puppet.conf`` file::
+`puppet.conf` file:
- [main]
- confdir = /private/puppet
- storeconfigs = true
+ [main]
+ confdir = /private/puppet
+ storeconfigs = true
Note that boolean parameters must be explicitly specified as `true` or
`false` as seen above.
If you need to change file parameters (e.g., reset the mode or owner), do
-so within curly braces on the same line::
+so within curly braces on the same line:
- [main]
- myfile = /tmp/whatever {owner = root, mode = 644}
+ [main]
+ myfile = /tmp/whatever {owner = root, mode = 644}
If you're starting out with a fresh configuration, you may wish to let
the executable generate a template configuration file for you by invoking
the executable in question with the `--genconfig` command. The executable
will print a template configuration to standard output, which can be
-redirected to a file like so::
+redirected to a file like so:
- $ puppet agent --genconfig > /etc/puppet/puppet.conf
+ $ puppet agent --genconfig > /etc/puppet/puppet.conf
Note that this invocation will replace the contents of any pre-existing
`puppet.conf` file, so make a backup of your present config if it contains
@@ -117,28 +118,30 @@ valuable information.
Like the `--genconfig` argument, the executables also accept a `--genmanifest`
argument, which will generate a manifest that can be used to manage all of
Puppet's directories and files and prints it to standard output. This can
-likewise be redirected to a file::
+likewise be redirected to a file:
- $ puppet agent --genmanifest > /etc/puppet/manifests/site.pp
+ $ puppet agent --genmanifest > /etc/puppet/manifests/site.pp
Puppet can also create user and group accounts for itself (one `puppet` group
-and one `puppet` user) if it is invoked as `root` with the `--mkusers` argument::
+and one `puppet` user) if it is invoked as `root` with the `--mkusers` argument:
- $ puppet agent --mkusers
+ $ puppet agent --mkusers
Signals
-------
-The ``puppet agent`` and ``puppet master`` executables catch some signals for special
-handling. Both daemons catch (``SIGHUP``), which forces the server to restart
-tself. Predictably, interrupt and terminate (``SIGINT`` and ``SIGTERM``) will shut
-down the server, whether it be an instance of ``puppet agent`` or ``puppet master``.
-Sending the ``SIGUSR1`` signal to an instance of ``puppet agent`` will cause it to
+The `puppet agent` and `puppet master` executables catch some signals for special
+handling. Both daemons catch (`SIGHUP`), which forces the server to restart
+tself. Predictably, interrupt and terminate (`SIGINT` and `SIGTERM`) will shut
+down the server, whether it be an instance of `puppet agent` or `puppet master`.
+
+Sending the `SIGUSR1` signal to an instance of `puppet agent` will cause it to
immediately begin a new configuration transaction with the server. This
-signal has no effect on ``puppet master``.
+signal has no effect on `puppet master`.
Configuration Parameter Reference
---------------------------------
+
Below is a list of all documented parameters. Not all of them are valid with all
Puppet executables, but the executables will ignore any inappropriate values.
diff --git a/lib/puppet/reference/indirection.rb b/lib/puppet/reference/indirection.rb
index d14510c16..0cdbb2510 100644
--- a/lib/puppet/reference/indirection.rb
+++ b/lib/puppet/reference/indirection.rb
@@ -26,9 +26,8 @@ end
reference.header = "This is the list of all indirections, their associated terminus classes, and how you select between them.
-In general, the appropriate terminus class is selected by the application for you (e.g., ``puppet agent`` would always use the ``rest``
-terminus for most of its indirected classes), but some classes are tunable via normal settings. These will have ``terminus setting``
-documentation listed with them.
+In general, the appropriate terminus class is selected by the application for you (e.g., `puppet agent` would always use the `rest`
+terminus for most of its indirected classes), but some classes are tunable via normal settings. These will have `terminus setting` documentation listed with them.
"
diff --git a/lib/puppet/reference/metaparameter.rb b/lib/puppet/reference/metaparameter.rb
index 6a319f1c2..39c4b7f5f 100644
--- a/lib/puppet/reference/metaparameter.rb
+++ b/lib/puppet/reference/metaparameter.rb
@@ -29,14 +29,6 @@ metaparameter = Puppet::Util::Reference.newreference :metaparameter, :doc => "Al
a.to_s <=> b.to_s
}.each { |param|
str += paramwrap(param.to_s, scrub(Puppet::Type.metaparamdoc(param)), :level => 4)
- #puts "<dt>#{param}</dt>"
- #puts tab(1) + Puppet::Type.metaparamdoc(param).scrub.indent($tab)gsub(/\n\s*/,' ')
- #puts "<dd>"
- #puts indent(scrub(Puppet::Type.metaparamdoc(param)), $tab)
- #puts scrub(Puppet::Type.metaparamdoc(param))
- #puts "</dd>"
-
- #puts ""
}
rescue => detail
puts detail.backtrace
diff --git a/lib/puppet/reference/network.rb b/lib/puppet/reference/network.rb
index 15e4f6769..fda7931fb 100644
--- a/lib/puppet/reference/network.rb
+++ b/lib/puppet/reference/network.rb
@@ -29,11 +29,11 @@ on the server, and the client knows how to call the handler's methods
appropriately.
Most handlers are meant to be started on the server, usually within
-``puppet master``, and the clients are mostly started on the client,
-usually within ``puppet agent``.
+`puppet master`, and the clients are mostly started on the client,
+usually within `puppet agent`.
You can find the server-side handler for each interface at
-``puppet/network/handler/<name>.rb`` and the client class at
-``puppet/network/client/<name>.rb``.
+`puppet/network/handler/<name>.rb` and the client class at
+`puppet/network/client/<name>.rb`.
"
diff --git a/lib/puppet/reference/providers.rb b/lib/puppet/reference/providers.rb
index ef33a559b..c85ad23ab 100644
--- a/lib/puppet/reference/providers.rb
+++ b/lib/puppet/reference/providers.rb
@@ -47,7 +47,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
# Add the suitability note
if missing = provider.suitable?(false) and missing.empty?
- data << "**X**"
+ data << "*X*"
suit = true
functional = true
else
@@ -86,7 +86,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
# Add a note for every feature
features.each do |feature|
if provider.features.include?(feature)
- data << "**X**"
+ data << "*X*"
else
data << ""
end
@@ -95,7 +95,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
ret += h(type.name.to_s + "_", 2)
- ret += ".. _#{type.name}: #{"http://docs.puppetlabs.com/references/stable/type.html##{type.name}"}\n\n"
+ ret += "[#{type.name}](#{"http://docs.puppetlabs.com/references/stable/type.html##{type.name}"})\n\n"
ret += option("Default provider", default)
ret += doctable(headers, table_data)
@@ -111,7 +111,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
ret
end
providers.header = "
-Puppet resource types are usually backed by multiple implementations called ``providers``,
+Puppet resource types are usually backed by multiple implementations called `providers`,
which handle variance between platforms and tools.
Different providers are suitable or unsuitable on different platforms based on things
diff --git a/lib/puppet/reference/report.rb b/lib/puppet/reference/report.rb
index 481ca2dc1..47fc779ab 100644
--- a/lib/puppet/reference/report.rb
+++ b/lib/puppet/reference/report.rb
@@ -7,16 +7,15 @@ end
report.header = "
Puppet clients can report back to the server after each transaction. This
transaction report is sent as a YAML dump of the
-``Puppet::Transaction::Report`` class and includes every log message that was
+`Puppet::Transaction::Report` class and includes every log message that was
generated during the transaction along with as many metrics as Puppet knows how
-to collect. See `ReportsAndReporting Reports and Reporting`:trac:
-for more information on how to use reports.
+to collect. See [Reports and Reporting](http://projects.puppetlabs.com/projects/puppet/wiki/Reports_And_Reporting) for more information on how to use reports.
Currently, clients default to not sending in reports; you can enable reporting
-by setting the ``report`` parameter to true.
+by setting the `report` parameter to true.
-To use a report, set the ``reports`` parameter on the server; multiple
-reports must be comma-separated. You can also specify ``none`` to disable
+To use a report, set the `reports` parameter on the server; multiple
+reports must be comma-separated. You can also specify `none` to disable
reports entirely.
Puppet provides multiple report handlers that will process client reports:
diff --git a/lib/puppet/reference/type.rb b/lib/puppet/reference/type.rb
index be8742edc..2378bb83a 100644
--- a/lib/puppet/reference/type.rb
+++ b/lib/puppet/reference/type.rb
@@ -16,25 +16,25 @@ type = Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource
- The *namevar* is the parameter used to uniquely identify a type instance.
This is the parameter that gets assigned when a string is provided before
the colon in a type declaration. In general, only developers will need to
- worry about which parameter is the ``namevar``.
+ worry about which parameter is the `namevar`.
- In the following code::
+ In the following code:
- file { "/etc/passwd":
- owner => root,
- group => root,
- mode => 644
- }
+ file { "/etc/passwd":
+ owner => root,
+ group => root,
+ mode => 644
+ }
- ``/etc/passwd`` is considered the title of the file object (used for things like
- dependency handling), and because ``path`` is the namevar for ``file``, that
- string is assigned to the ``path`` parameter.
+ `/etc/passwd` is considered the title of the file object (used for things like
+ dependency handling), and because `path` is the namevar for `file`, that
+ string is assigned to the `path` parameter.
-- *Parameters* determine the specific configuration of the instance. They either
+ - *Parameters* determine the specific configuration of the instance. They either
directly modify the system (internally, these are called properties) or they affect
- how the instance behaves (e.g., adding a search path for ``exec`` instances or determining recursion on ``file`` instances).
+ how the instance behaves (e.g., adding a search path for `exec` instances or determining recursion on `file` instances).
-- *Providers* provide low-level functionality for a given resource type. This is
+ - *Providers* provide low-level functionality for a given resource type. This is
usually in the form of calling out to external commands.
When required binaries are specified for providers, fully qualifed paths
@@ -42,7 +42,7 @@ type = Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource
binaries indicate that Puppet will search for the binary using the shell
path.
-- *Features* are abilities that some providers might not support. You can use the list
+ - *Features* are abilities that some providers might not support. You can use the list
of supported features to determine how a given provider can be used.
Resource types define features they can use, and providers can be tested to see
diff --git a/lib/puppet/reports/http.rb b/lib/puppet/reports/http.rb
index f1a74195d..7ac54dfbd 100644
--- a/lib/puppet/reports/http.rb
+++ b/lib/puppet/reports/http.rb
@@ -5,7 +5,7 @@ require 'uri'
Puppet::Reports.register_report(:http) do
desc <<-DESC
- Send report information via HTTP to the ``reporturl``. Each host sends
+ Send report information via HTTP to the `reporturl`. Each host sends
its report as a YAML dump and this sends this YAML to a client via HTTP POST.
The YAML is the `report` parameter of the request."
DESC
diff --git a/lib/puppet/reports/rrdgraph.rb b/lib/puppet/reports/rrdgraph.rb
index 9fbeb60e8..2357e233e 100644
--- a/lib/puppet/reports/rrdgraph.rb
+++ b/lib/puppet/reports/rrdgraph.rb
@@ -1,12 +1,11 @@
Puppet::Reports.register_report(:rrdgraph) do
desc "Graph all available data about hosts using the RRD library. You
must have the Ruby RRDtool library installed to use this report, which
- you can get from `the RubyRRDTool RubyForge page`_. This package may also
- be available as ``ruby-rrd`` or ``rrdtool-ruby`` in your distribution's package
- management system. The library and/or package will both require the binary
- ``rrdtool`` package from your distribution to be installed.
-
- .. _the RubyRRDTool RubyForge page: http://rubyforge.org/projects/rubyrrdtool/
+ you can get from
+ [the RubyRRDTool RubyForge page](http://rubyforge.org/projects/rubyrrdtool/).
+ This package may also be available as `ruby-rrd` or `rrdtool-ruby` in your
+ distribution's package management system. The library and/or package will both
+ require the binary `rrdtool` package from your distribution to be installed.
This report will create, manage, and graph RRD database files for each
of the metrics generated during transactions, and it will create a
@@ -14,12 +13,12 @@ Puppet::Reports.register_report(:rrdgraph) do
point, it will not create a common index file to display links to
all hosts.
- All RRD files and graphs get created in the ``rrddir`` directory. If
+ All RRD files and graphs get created in the `rrddir` directory. If
you want to serve these publicly, you should be able to just alias that
directory in a web server.
- If you really know what you're doing, you can tune the ``rrdinterval``,
- which defaults to the ``runinterval``."
+ If you really know what you're doing, you can tune the `rrdinterval`,
+ which defaults to the `runinterval`."
def hostdir
@hostdir ||= File.join(Puppet[:rrddir], self.host)
diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb
index 65159fc07..30f24591c 100644
--- a/lib/puppet/reports/store.rb
+++ b/lib/puppet/reports/store.rb
@@ -2,7 +2,7 @@ require 'puppet'
Puppet::Reports.register_report(:store) do
desc "Store the yaml report on disk. Each host sends its report as a YAML dump
- and this just stores the file on disk, in the ``reportdir`` directory.
+ and this just stores the file on disk, in the `reportdir` directory.
These files collect quickly -- one every half hour -- so it is a good idea
to perform some maintenance on them if you use this report (it's the only
@@ -19,7 +19,7 @@ Puppet::Reports.register_report(:store) do
:owner => 'service',
:group => 'service'
},
-
+
:noop => [false, "Used by settings internally."]
)
diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb
index 652104096..71bafb2da 100644
--- a/lib/puppet/reports/tagmail.rb
+++ b/lib/puppet/reports/tagmail.rb
@@ -6,12 +6,12 @@ require 'time'
Puppet::Reports.register_report(:tagmail) do
desc "This report sends specific log messages to specific email addresses
- based on the tags in the log messages. See the
- `UsingTags tag documentation`:trac: for more information
- on tags.
+ based on the tags in the log messages.
- To use this report, you must create a ``tagmail.conf`` (in the location
- specified by ``tagmap``). This is a simple file that maps tags to
+ See the [UsingTags tag documentation](http://projects.puppetlabs.com/projects/puppet/wiki/Using_Tags) for more information on tags.
+
+ To use this report, you must create a `tagmail.conf` (in the location
+ specified by `tagmap`). This is a simple file that maps tags to
email addresses: Any log messages in the report that match the specified
tags will be sent to the specified email addresses.
@@ -20,21 +20,20 @@ Puppet::Reports.register_report(:tagmail) do
the email addresses by a colon, and the email addresses should also
be comma-separated.
- Lastly, there is an ``all`` tag that will always match all log messages.
+ Lastly, there is an `all` tag that will always match all log messages.
- Here is an example tagmail.conf::
+ Here is an example `tagmail.conf`:
- all: me@domain.com
- webserver, !mailserver: httpadmins@domain.com
+ all: me@domain.com
+ webserver, !mailserver: httpadmins@domain.com
- This will send all messages to ``me@domain.com``, and all messages from
- webservers that are not also from mailservers to ``httpadmins@domain.com``.
+ This will send all messages to `me@domain.com`, and all messages from
+ webservers that are not also from mailservers to `httpadmins@domain.com`.
If you are using anti-spam controls, such as grey-listing, on your mail
- server you should whitelist the sending email (controlled by ``reportform`` configuration option) to ensure your email is not discarded as spam.
+ server you should whitelist the sending email (controlled by `reportform` configuration option) to ensure your email is not discarded as spam.
"
-
# Find all matching messages.
def match(taglists)
matching_logs = []
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index 96d22e414..c4e52af18 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -13,7 +13,7 @@ class Puppet::Resource
extend Puppet::Util::Pson
include Enumerable
attr_accessor :file, :line, :catalog, :exported, :virtual, :validate_parameters, :strict
- attr_reader :namespaces
+ attr_reader :type, :title
require 'puppet/indirector'
extend Puppet::Indirector
@@ -157,27 +157,26 @@ class Puppet::Resource
# Create our resource.
def initialize(type, title = nil, attributes = {})
@parameters = {}
- @namespaces = [""]
- # Set things like namespaces and strictness first.
+ # Set things like strictness first.
attributes.each do |attr, value|
next if attr == :parameters
send(attr.to_s + "=", value)
end
- # We do namespaces first, and use tmp variables, so our title
- # canonicalization works (i.e., namespaces are set and resource
- # types can be looked up)
- tmp_type, tmp_title = extract_type_and_title(type, title)
- self.type = tmp_type
- self.title = tmp_title
+ @type, @title = extract_type_and_title(type, title)
+
+ @type = munge_type_name(@type)
+
+ if @type == "Class"
+ @title = :main if @title == ""
+ @title = munge_type_name(@title)
+ end
if params = attributes[:parameters]
extract_parameters(params)
end
- resolve_type_and_title
-
tag(self.type)
tag(self.title) if valid_tag?(self.title)
@@ -193,17 +192,12 @@ class Puppet::Resource
return(catalog ? catalog.resource(to_s) : nil)
end
- def title=(value)
- @unresolved_title = value
- @title = nil
- end
-
def resource_type
@resource_type ||= case type
- when "Class"; find_hostclass(title)
- when "Node"; find_node(title)
+ when "Class"; known_resource_types.hostclass(title == :main ? "" : title)
+ when "Node"; known_resource_types.node(title)
else
- find_resource_type(type)
+ Puppet::Type.type(type.to_s.downcase.to_sym) || known_resource_types.definition(type)
end
end
@@ -314,28 +308,6 @@ class Puppet::Resource
self
end
- # We have to lazy-evaluate this.
- def title=(value)
- @title = nil
- @unresolved_title = value
- end
-
- # We have to lazy-evaluate this.
- def type=(value)
- @type = nil
- @unresolved_type = value || "Class"
- end
-
- def title
- resolve_type_and_title unless @title
- @title
- end
-
- def type
- resolve_type_and_title unless @type
- @type
- end
-
def valid_parameter?(name)
resource_type.valid_parameter?(name)
end
@@ -346,29 +318,6 @@ class Puppet::Resource
private
- def find_node(name)
- known_resource_types.node(name)
- end
-
- def find_hostclass(title)
- name = title == :main ? "" : title
- known_resource_types.find_hostclass(namespaces, name)
- end
-
- def find_resource_type(type)
- # It still works fine without the type == 'class' short-cut, but it is a lot slower.
- return nil if ["class", "node"].include? type.to_s.downcase
- find_builtin_resource_type(type) || find_defined_resource_type(type)
- end
-
- def find_builtin_resource_type(type)
- Puppet::Type.type(type.to_s.downcase.to_sym)
- end
-
- def find_defined_resource_type(type)
- known_resource_types.find_definition(namespaces, type.to_s.downcase)
- end
-
# Produce a canonical method name.
def parameter_name(param)
param = param.to_s.downcase.to_sym
@@ -378,10 +327,6 @@ class Puppet::Resource
param
end
- def namespaces=(ns)
- @namespaces = Array(ns)
- end
-
# The namevar for our resource type. If the type doesn't exist,
# always use :name.
def namevar
@@ -428,54 +373,9 @@ class Puppet::Resource
value.to_s.split("::").collect { |s| s.capitalize }.join("::")
end
- # This is an annoyingly complicated method for resolving qualified
- # types as necessary, and putting them in type or title attributes.
- def resolve_type_and_title
- if @unresolved_type
- @type = resolve_type
- @unresolved_type = nil
- end
- if @unresolved_title
- @title = resolve_title
- @unresolved_title = nil
- end
- end
-
- def resolve_type
- case type = munge_type_name(@unresolved_type)
- when "Class", "Node";
- type
- else
- # Otherwise, some kind of builtin or defined resource type
- munge_type_name( (r = find_resource_type(type)) ? r.name : type)
- end
- end
-
- # This method only works if resolve_type was called first
- def resolve_title
- case @type
- when "Node"; return @unresolved_title
- when "Class";
- resolve_title_for_class(@unresolved_title)
- else
- @unresolved_title
- end
- end
-
- def resolve_title_for_class(title)
- if title == "" or title == :main
- return :main
- end
-
- if klass = find_hostclass(title)
- result = klass.name
- end
- munge_type_name(result || title)
- end
-
def parse_title
h = {}
- type = find_resource_type(@type)
+ type = resource_type
if type.respond_to? :title_patterns
type.title_patterns.each { |regexp, symbols_and_lambdas|
if captures = regexp.match(title.to_s)
diff --git a/lib/puppet/resource/type_collection.rb b/lib/puppet/resource/type_collection.rb
index 90b6df9c1..63d110395 100644
--- a/lib/puppet/resource/type_collection.rb
+++ b/lib/puppet/resource/type_collection.rb
@@ -96,8 +96,8 @@ class Puppet::Resource::TypeCollection
#Array("") == [] for some reason
namespaces = [namespaces] unless namespaces.is_a?(Array)
- if r = find_fully_qualified(name, type)
- return r
+ if name =~ /^::/
+ return send(type, name.sub(/^::/, ''))
end
namespaces.each do |namespace|
@@ -198,10 +198,6 @@ class Puppet::Resource::TypeCollection
private
- def find_fully_qualified(name, type)
- send(type, name.sub(/^::/, ''))
- end
-
def find_partially_qualified(namespace, name, type)
send(type, [namespace, name].join("::"))
end
diff --git a/lib/puppet/transaction/resource_harness.rb b/lib/puppet/transaction/resource_harness.rb
index aace6a38a..29ec9a539 100644
--- a/lib/puppet/transaction/resource_harness.rb
+++ b/lib/puppet/transaction/resource_harness.rb
@@ -72,7 +72,7 @@ class Puppet::Transaction::ResourceHarness
resource[param] = value
audited << param
else
- resource.info "Storing newly-audited value #{current[param]} for #{param}"
+ resource.debug "Storing newly-audited value #{current[param]} for #{param}"
cache(resource, param, current[param])
end
end
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index c3855a400..53c23aa32 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -933,16 +933,16 @@ class Type
newmetaparam(:schedule) do
desc "On what schedule the object should be managed. You must create a
schedule object, and then reference the name of that object to use
- that for your schedule::
+ that for your schedule:
- schedule { daily:
- period => daily,
- range => \"2-4\"
- }
+ schedule { daily:
+ period => daily,
+ range => \"2-4\"
+ }
- exec { \"/usr/bin/apt-get update\":
- schedule => daily
- }
+ exec { \"/usr/bin/apt-get update\":
+ schedule => daily
+ }
The creation of the schedule object does not need to appear in the
configuration before objects that use it."
@@ -1020,40 +1020,40 @@ class Type
newmetaparam(:alias) do
desc "Creates an alias for the object. Puppet uses this internally when you
- provide a symbolic name::
-
- file { sshdconfig:
- path => $operatingsystem ? {
- solaris => \"/usr/local/etc/ssh/sshd_config\",
- default => \"/etc/ssh/sshd_config\"
- },
- source => \"...\"
- }
+ provide a symbolic name:
+
+ file { sshdconfig:
+ path => $operatingsystem ? {
+ solaris => \"/usr/local/etc/ssh/sshd_config\",
+ default => \"/etc/ssh/sshd_config\"
+ },
+ source => \"...\"
+ }
- service { sshd:
- subscribe => file[sshdconfig]
- }
+ service { sshd:
+ subscribe => file[sshdconfig]
+ }
- When you use this feature, the parser sets ``sshdconfig`` as the name,
+ When you use this feature, the parser sets `sshdconfig` as the name,
and the library sets that as an alias for the file so the dependency
- lookup for ``sshd`` works. You can use this parameter yourself,
+ lookup for `sshd` works. You can use this parameter yourself,
but note that only the library can use these aliases; for instance,
- the following code will not work::
+ the following code will not work:
- file { \"/etc/ssh/sshd_config\":
- owner => root,
- group => root,
- alias => sshdconfig
- }
+ file { \"/etc/ssh/sshd_config\":
+ owner => root,
+ group => root,
+ alias => sshdconfig
+ }
- file { sshdconfig:
- mode => 644
- }
+ file { sshdconfig:
+ mode => 644
+ }
There's no way here for the Puppet parser to know that these two stanzas
should be affecting the same file.
- See the `LanguageTutorial language tutorial`:trac: for more information.
+ See the [Language Tutorial](http://docs.puppetlabs.com/guides/language_tutorial.html) for more information.
"
@@ -1083,9 +1083,9 @@ class Type
be useful to add your own tags to a given resource.
Tags are currently useful for things like applying a subset of a
- host's configuration::
+ host's configuration:
- puppet agent --test --tags mytag
+ puppet agent --test --tags mytag
This way, when you're testing a configuration you can run just the
portion you're testing."
@@ -1189,23 +1189,23 @@ class Type
newmetaparam(:require, :parent => RelationshipMetaparam, :attributes => {:direction => :in, :events => :NONE}) do
desc "One or more objects that this object depends on.
This is used purely for guaranteeing that changes to required objects
- happen before the dependent object. For instance::
+ happen before the dependent object. For instance:
- # Create the destination directory before you copy things down
- file { \"/usr/local/scripts\":
- ensure => directory
- }
+ # Create the destination directory before you copy things down
+ file { \"/usr/local/scripts\":
+ ensure => directory
+ }
- file { \"/usr/local/scripts/myscript\":
- source => \"puppet://server/module/myscript\",
- mode => 755,
- require => File[\"/usr/local/scripts\"]
- }
+ file { \"/usr/local/scripts/myscript\":
+ source => \"puppet://server/module/myscript\",
+ mode => 755,
+ require => File[\"/usr/local/scripts\"]
+ }
Multiple dependencies can be specified by providing a comma-seperated list
- of resources, enclosed in square brackets::
+ of resources, enclosed in square brackets:
- require => [ File[\"/usr/local\"], File[\"/usr/local/scripts\"] ]
+ require => [ File[\"/usr/local\"], File[\"/usr/local/scripts\"] ]
Note that Puppet will autorequire everything that it can, and
there are hooks in place so that it's easy for resources to add new
@@ -1219,10 +1219,10 @@ class Type
Currently, exec resources will autorequire their CWD (if it is
specified) plus any fully qualified paths that appear in the
- command. For instance, if you had an ``exec`` command that ran
- the ``myscript`` mentioned above, the above code that pulls the
+ command. For instance, if you had an `exec` command that ran
+ the `myscript` mentioned above, the above code that pulls the
file down would be automatically listed as a requirement to the
- ``exec`` code, so that you would always be running againts the
+ `exec` code, so that you would always be running againts the
most recent version.
"
end
@@ -1230,20 +1230,20 @@ class Type
newmetaparam(:subscribe, :parent => RelationshipMetaparam, :attributes => {:direction => :in, :events => :ALL_EVENTS, :callback => :refresh}) do
desc "One or more objects that this object depends on. Changes in the
subscribed to objects result in the dependent objects being
- refreshed (e.g., a service will get restarted). For instance::
-
- class nagios {
- file { \"/etc/nagios/nagios.conf\":
- source => \"puppet://server/module/nagios.conf\",
- alias => nagconf # just to make things easier for me
+ refreshed (e.g., a service will get restarted). For instance:
+
+ class nagios {
+ file { \"/etc/nagios/nagios.conf\":
+ source => \"puppet://server/module/nagios.conf\",
+ alias => nagconf # just to make things easier for me
+ }
+ service { nagios:
+ ensure => running,
+ subscribe => File[nagconf]
+ }
}
- service { nagios:
- ensure => running,
- subscribe => File[nagconf]
- }
- }
- Currently the ``exec``, ``mount`` and ``service`` type support
+ Currently the `exec`, `mount` and `service` type support
refreshing.
"
end
@@ -1251,18 +1251,18 @@ class Type
newmetaparam(:before, :parent => RelationshipMetaparam, :attributes => {:direction => :out, :events => :NONE}) do
desc %{This parameter is the opposite of **require** -- it guarantees
that the specified object is applied later than the specifying
- object::
+ object:
- file { "/var/nagios/configuration":
- source => "...",
- recurse => true,
- before => Exec["nagios-rebuid"]
- }
+ file { "/var/nagios/configuration":
+ source => "...",
+ recurse => true,
+ before => Exec["nagios-rebuid"]
+ }
- exec { "nagios-rebuild":
- command => "/usr/bin/make",
- cwd => "/var/nagios/configuration"
- }
+ exec { "nagios-rebuild":
+ command => "/usr/bin/make",
+ cwd => "/var/nagios/configuration"
+ }
This will make sure all of the files are up to date before the
make command is run.}
@@ -1270,16 +1270,16 @@ class Type
newmetaparam(:notify, :parent => RelationshipMetaparam, :attributes => {:direction => :out, :events => :ALL_EVENTS, :callback => :refresh}) do
desc %{This parameter is the opposite of **subscribe** -- it sends events
- to the specified object::
+ to the specified object:
- file { "/etc/sshd_config":
- source => "....",
- notify => Service[sshd]
- }
+ file { "/etc/sshd_config":
+ source => "....",
+ notify => Service[sshd]
+ }
- service { sshd:
- ensure => running
- }
+ service { sshd:
+ ensure => running
+ }
This will restart the sshd service if the sshd config file changes.}
end
@@ -1293,24 +1293,24 @@ class Type
By default, all classes get directly added to the
'main' stage. You can create new stages as resources:
- stage { [pre, post]: }
+ stage { [pre, post]: }
To order stages, use standard relationships:
- stage { pre: before => Stage[main] }
+ stage { pre: before => Stage[main] }
Or use the new relationship syntax:
- Stage[pre] -> Stage[main] -> Stage[post]
+ Stage[pre] -> Stage[main] -> Stage[post]
Then use the new class parameters to specify a stage:
- class { foo: stage => pre }
+ class { foo: stage => pre }
Stages can only be set on classes, not individual resources. This will
- fail::
+ fail:
- file { '/foo': stage => pre, ensure => file }
+ file { '/foo': stage => pre, ensure => file }
}
end
diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb
index 7fcfdd7a3..d29bda648 100644
--- a/lib/puppet/type/augeas.rb
+++ b/lib/puppet/type/augeas.rb
@@ -28,27 +28,28 @@ Puppet::Type.newtype(:augeas) do
via the augeas tool.
Requires:
- - augeas to be installed (http://www.augeas.net)
- - ruby-augeas bindings
- Sample usage with a string::
+ - augeas to be installed (http://www.augeas.net)
+ - ruby-augeas bindings
- augeas{\"test1\" :
- context => \"/files/etc/sysconfig/firstboot\",
- changes => \"set RUN_FIRSTBOOT YES\",
- onlyif => \"match other_value size > 0\",
- }
+ Sample usage with a string:
- Sample usage with an array and custom lenses::
+ augeas{\"test1\" :
+ context => \"/files/etc/sysconfig/firstboot\",
+ changes => \"set RUN_FIRSTBOOT YES\",
+ onlyif => \"match other_value size > 0\",
+ }
- augeas{\"jboss_conf\":
- context => \"/files\",
- changes => [
- \"set /etc/jbossas/jbossas.conf/JBOSS_IP $ipaddress\",
- \"set /etc/jbossas/jbossas.conf/JAVA_HOME /usr\"
- ],
- load_path => \"$/usr/share/jbossas/lenses\",
- }
+ Sample usage with an array and custom lenses:
+
+ augeas{\"jboss_conf\":
+ context => \"/files\",
+ changes => [
+ \"set /etc/jbossas/jbossas.conf/JBOSS_IP $ipaddress\",
+ \"set /etc/jbossas/jbossas.conf/JAVA_HOME /usr\"
+ ],
+ load_path => \"$/usr/share/jbossas/lenses\",
+ }
"
@@ -71,23 +72,23 @@ Puppet::Type.newtype(:augeas) do
newparam (:onlyif) do
desc "Optional augeas command and comparisons to control the execution of this type.
- Supported onlyif syntax::
-
- get [AUGEAS_PATH] [COMPARATOR] [STRING]
- match [MATCH_PATH] size [COMPARATOR] [INT]
- match [MATCH_PATH] include [STRING]
- match [MATCH_PATH] not_include [STRING]
- match [MATCH_PATH] == [AN_ARRAY]
- match [MATCH_PATH] != [AN_ARRAY]
-
- where::
-
- AUGEAS_PATH is a valid path scoped by the context
- MATCH_PATH is a valid match synatx scoped by the context
- COMPARATOR is in the set [> >= != == <= <]
- STRING is a string
- INT is a number
- AN_ARRAY is in the form ['a string', 'another']"
+ Supported onlyif syntax:
+
+ get [AUGEAS_PATH] [COMPARATOR] [STRING]
+ match [MATCH_PATH] size [COMPARATOR] [INT]
+ match [MATCH_PATH] include [STRING]
+ match [MATCH_PATH] not_include [STRING]
+ match [MATCH_PATH] == [AN_ARRAY]
+ match [MATCH_PATH] != [AN_ARRAY]
+
+ where:
+
+ AUGEAS_PATH is a valid path scoped by the context
+ MATCH_PATH is a valid match synatx scoped by the context
+ COMPARATOR is in the set [> >= != == <= <]
+ STRING is a string
+ INT is a number
+ AN_ARRAY is in the form ['a string', 'another']"
defaultto ""
end
@@ -95,16 +96,14 @@ Puppet::Type.newtype(:augeas) do
newparam(:changes) do
desc "The changes which should be applied to the filesystem. This
can be either a string which contains a command or an array of commands.
- Commands supported are::
+ Commands supported are:
- set [PATH] [VALUE] Sets the value VALUE at loction PATH
- rm [PATH] Removes the node at location PATH
- remove [PATH] Synonym for rm
- clear [PATH] Keeps the node at PATH, but removes the value.
- ins [LABEL] [WHERE] [PATH]
- Inserts an empty node LABEL either [WHERE={before|after}] PATH.
- insert [LABEL] [WHERE] [PATH]
- Synonym for ins
+ set [PATH] [VALUE] Sets the value VALUE at loction PATH
+ rm [PATH] Removes the node at location PATH
+ remove [PATH] Synonym for rm
+ clear [PATH] Keeps the node at PATH, but removes the value.
+ ins [LABEL] [WHERE] [PATH] Inserts an empty node LABEL either [WHERE={before|after}] PATH.
+ insert [LABEL] [WHERE] [PATH] Synonym for ins
If the parameter 'context' is set that value is prepended to PATH"
end
@@ -136,11 +135,11 @@ Puppet::Type.newtype(:augeas) do
end
newparam(:lens) do
- desc "Use a specific lens, e.g. 'Hosts.lns'. When this parameter is set, you must also set the incl parameter to indicate which file to load. Only that file will be loaded, which greatly speeds up execution of the type"
+ desc "Use a specific lens, e.g. `Hosts.lns`. When this parameter is set, you must also set the incl parameter to indicate which file to load. Only that file will be loaded, which greatly speeds up execution of the type"
end
newparam(:incl) do
- desc "Load only a specific file, e.g. '/etc/hosts'. When this parameter is set, you must also set the lens parameter to indicate which lens to use."
+ desc "Load only a specific file, e.g. `/etc/hosts`. When this parameter is set, you must also set the lens parameter to indicate which lens to use."
end
validate do
diff --git a/lib/puppet/type/computer.rb b/lib/puppet/type/computer.rb
index 86a30be27..89a0692bf 100644
--- a/lib/puppet/type/computer.rb
+++ b/lib/puppet/type/computer.rb
@@ -10,7 +10,7 @@ Puppet::Type.newtype(:computer) do
This provider only manages Computer objects in the local directory service
domain, not in remote directories.
- If you wish to manage /etc/hosts on Mac OS X, then simply use the host
+ If you wish to manage `/etc/hosts` file on Mac OS X, then simply use the host
type as per other platforms.
This type primarily exists to create localhost Computer objects that MCX
@@ -31,7 +31,7 @@ Puppet::Type.newtype(:computer) do
newproperty(:ensure, :parent => Puppet::Property::Ensure) do
desc "Control the existences of this computer record. Set this attribute to
- ``present`` to ensure the computer record exists. Set it to ``absent``
+ `present` to ensure the computer record exists. Set it to `absent`
to delete any computer records with this name"
newvalue(:present) do
provider.create
diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb
index b3f5e608d..9d827df78 100755
--- a/lib/puppet/type/cron.rb
+++ b/lib/puppet/type/cron.rb
@@ -15,32 +15,32 @@ Puppet::Type.newtype(:cron) do
association is made and synced to disk, you can then manage the job
normally (e.g., change the schedule of the job).
- Example::
-
- cron { logrotate:
- command => \"/usr/sbin/logrotate\",
- user => root,
- hour => 2,
- minute => 0
- }
-
- Note that all cron values can be specified as an array of values::
-
- cron { logrotate:
- command => \"/usr/sbin/logrotate\",
- user => root,
- hour => [2, 4]
- }
-
- Or using ranges, or the step syntax ``*/2`` (although there's no guarantee that
- your ``cron`` daemon supports it)::
-
- cron { logrotate:
- command => \"/usr/sbin/logrotate\",
- user => root,
- hour => ['2-4'],
- minute => '*/10'
- }
+ Example:
+
+ cron { logrotate:
+ command => \"/usr/sbin/logrotate\",
+ user => root,
+ hour => 2,
+ minute => 0
+ }
+
+ Note that all cron values can be specified as an array of values:
+
+ cron { logrotate:
+ command => \"/usr/sbin/logrotate\",
+ user => root,
+ hour => [2, 4]
+ }
+
+ Or using ranges, or the step syntax `*/2` (although there's no guarantee that
+ your `cron` daemon supports it):
+
+ cron { logrotate:
+ command => \"/usr/sbin/logrotate\",
+ user => root,
+ hour => ['2-4'],
+ minute => '*/10'
+ }
"
ensurable
@@ -206,7 +206,7 @@ Puppet::Type.newtype(:cron) do
profile is not sourced when the command is run, so if the
user's environment is desired it should be sourced manually.
- All cron parameters support ``absent`` as a value; this will
+ All cron parameters support `absent` as a value; this will
remove any existing values for that field."
def retrieve
@@ -293,7 +293,7 @@ Puppet::Type.newtype(:cron) do
but will not associate them with a specific job.
Settings should be specified exactly as they should appear in
- the crontab, e.g., ``PATH=/bin:/usr/bin:/usr/sbin``."
+ the crontab, e.g., `PATH=/bin:/usr/bin:/usr/sbin`."
validate do |value|
unless value =~ /^\s*(\w+)\s*=\s*(.*)\s*$/ or value == :absent or value == "absent"
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb
index bfeaaad34..dd57ec231 100755
--- a/lib/puppet/type/exec.rb
+++ b/lib/puppet/type/exec.rb
@@ -6,51 +6,51 @@ module Puppet
@doc = "Executes external commands. It is critical that all commands
executed using this mechanism can be run multiple times without
harm, i.e., they are *idempotent*. One useful way to create idempotent
- commands is to use the checks like ``creates`` to avoid running the
+ commands is to use the checks like `creates` to avoid running the
command unless some condition is met.
- Note also that you can restrict an ``exec`` to only run when it receives
- events by using the ``refreshonly`` parameter; this is a useful way to
+ Note also that you can restrict an `exec` to only run when it receives
+ events by using the `refreshonly` parameter; this is a useful way to
have your configuration respond to events with arbitrary commands.
- It is worth noting that ``exec`` is special, in that it is not
- currently considered an error to have multiple ``exec`` instances
+ It is worth noting that `exec` is special, in that it is not
+ currently considered an error to have multiple `exec` instances
with the same name. This was done purely because it had to be this
way in order to get certain functionality, but it complicates things.
- In particular, you will not be able to use ``exec`` instances that
+ In particular, you will not be able to use `exec` instances that
share their commands with other instances as a dependency, since
Puppet has no way of knowing which instance you mean.
- For example::
+ For example:
- # defined in the production class
- exec { \"make\":
- cwd => \"/prod/build/dir\",
- path => \"/usr/bin:/usr/sbin:/bin\"
- }
+ # defined in the production class
+ exec { \"make\":
+ cwd => \"/prod/build/dir\",
+ path => \"/usr/bin:/usr/sbin:/bin\"
+ }
- . etc. .
+ . etc. .
- # defined in the test class
- exec { \"make\":
- cwd => \"/test/build/dir\",
- path => \"/usr/bin:/usr/sbin:/bin\"
- }
+ # defined in the test class
+ exec { \"make\":
+ cwd => \"/test/build/dir\",
+ path => \"/usr/bin:/usr/sbin:/bin\"
+ }
Any other type would throw an error, complaining that you had
the same instance being managed in multiple places, but these are
- obviously different images, so ``exec`` had to be treated specially.
+ obviously different images, so `exec` had to be treated specially.
It is recommended to avoid duplicate names whenever possible.
- Note that if an ``exec`` receives an event from another resource,
- it will get executed again (or execute the command specified in ``refresh``, if there is one).
+ Note that if an `exec` receives an event from another resource,
+ it will get executed again (or execute the command specified in `refresh`, if there is one).
- There is a strong tendency to use ``exec`` to do whatever work Puppet
+ There is a strong tendency to use `exec` to do whatever work Puppet
can't already do; while this is obviously acceptable (and unavoidable)
- in the short term, it is highly recommended to migrate work from ``exec``
+ in the short term, it is highly recommended to migrate work from `exec`
to native Puppet types as quickly as possible. If you find that
- you are doing a lot of work with ``exec``, please at least notify
+ you are doing a lot of work with `exec`, please at least notify
us at Puppet Labs what you are doing, and hopefully we can work with
you to get a native resource type for the work you are doing."
@@ -159,9 +159,9 @@ module Puppet
desc "The actual command to execute. Must either be fully qualified
or a search path for the command must be provided. If the command
succeeds, any output produced will be logged at the instance's
- normal log level (usually ``notice``), but if the command fails
+ normal log level (usually `notice`), but if the command fails
(meaning its return code does not match the specified code) then
- any output is logged at the ``err`` log level."
+ any output is logged at the `err` log level."
end
newparam(:path) do
@@ -223,7 +223,7 @@ module Puppet
newparam(:logoutput) do
desc "Whether to log output. Defaults to logging output at the
- loglevel for the ``exec`` resource. Use *on_failure* to only
+ loglevel for the `exec` resource. Use *on_failure* to only
log the output when the command reports an error. Values are
**true**, *false*, *on_failure*, and any legal log level."
@@ -253,7 +253,7 @@ module Puppet
newparam(:environment) do
desc "Any additional environment variables you want to set for a
command. Note that if you use this to set PATH, it will override
- the ``path`` attribute. Multiple environment variables should be
+ the `path` attribute. Multiple environment variables should be
specified as an array."
validate do |values|
@@ -330,22 +330,22 @@ module Puppet
desc "The command should only be run as a
refresh mechanism for when a dependent object is changed. It only
makes sense to use this option when this command depends on some
- other object; it is useful for triggering an action::
-
- # Pull down the main aliases file
- file { \"/etc/aliases\":
- source => \"puppet://server/module/aliases\"
- }
-
- # Rebuild the database, but only when the file changes
- exec { newaliases:
- path => [\"/usr/bin\", \"/usr/sbin\"],
- subscribe => File[\"/etc/aliases\"],
- refreshonly => true
- }
+ other object; it is useful for triggering an action:
+
+ # Pull down the main aliases file
+ file { \"/etc/aliases\":
+ source => \"puppet://server/module/aliases\"
+ }
+
+ # Rebuild the database, but only when the file changes
+ exec { newaliases:
+ path => [\"/usr/bin\", \"/usr/sbin\"],
+ subscribe => File[\"/etc/aliases\"],
+ refreshonly => true
+ }
- Note that only ``subscribe`` and ``notify`` can trigger actions, not ``require``,
- so it only makes sense to use ``refreshonly`` with ``subscribe`` or ``notify``."
+ Note that only `subscribe` and `notify` can trigger actions, not `require`,
+ so it only makes sense to use `refreshonly` with `subscribe` or `notify`."
newvalues(:true, :false)
@@ -364,13 +364,13 @@ module Puppet
newcheck(:creates) do
desc "A file that this command creates. If this
parameter is provided, then the command will only be run
- if the specified file does not exist::
+ if the specified file does not exist:
- exec { \"tar xf /my/tar/file.tar\":
- cwd => \"/var/tmp\",
- creates => \"/var/tmp/myfile\",
- path => [\"/usr/bin\", \"/usr/sbin\"]
- }
+ exec { \"tar xf /my/tar/file.tar\":
+ cwd => \"/var/tmp\",
+ creates => \"/var/tmp/myfile\",
+ path => [\"/usr/bin\", \"/usr/sbin\"]
+ }
"
@@ -396,16 +396,16 @@ module Puppet
end
newcheck(:unless) do
- desc "If this parameter is set, then this ``exec`` will run unless
- the command returns 0. For example::
+ desc "If this parameter is set, then this `exec` will run unless
+ the command returns 0. For example:
- exec { \"/bin/echo root >> /usr/lib/cron/cron.allow\":
- path => \"/usr/bin:/usr/sbin:/bin\",
- unless => \"grep root /usr/lib/cron/cron.allow 2>/dev/null\"
- }
+ exec { \"/bin/echo root >> /usr/lib/cron/cron.allow\":
+ path => \"/usr/bin:/usr/sbin:/bin\",
+ unless => \"grep root /usr/lib/cron/cron.allow 2>/dev/null\"
+ }
- This would add ``root`` to the cron.allow file (on Solaris) unless
- ``grep`` determines it's already there.
+ This would add `root` to the cron.allow file (on Solaris) unless
+ `grep` determines it's already there.
Note that this command follows the same rules as the main command,
which is to say that it must be fully qualified if the path is not set.
@@ -433,22 +433,22 @@ module Puppet
end
newcheck(:onlyif) do
- desc "If this parameter is set, then this ``exec`` will only run if
- the command returns 0. For example::
+ desc "If this parameter is set, then this `exec` will only run if
+ the command returns 0. For example:
- exec { \"logrotate\":
- path => \"/usr/bin:/usr/sbin:/bin\",
- onlyif => \"test `du /var/log/messages | cut -f1` -gt 100000\"
- }
+ exec { \"logrotate\":
+ path => \"/usr/bin:/usr/sbin:/bin\",
+ onlyif => \"test `du /var/log/messages | cut -f1` -gt 100000\"
+ }
- This would run ``logrotate`` only if that test returned true.
+ This would run `logrotate` only if that test returned true.
Note that this command follows the same rules as the main command,
which is to say that it must be fully qualified if the path is not set.
- Also note that onlyif can take an array as its value, eg::
+ Also note that onlyif can take an array as its value, e.g.:
- onlyif => [\"test -f /tmp/file1\", \"test -f /tmp/file2\"]
+ onlyif => [\"test -f /tmp/file1\", \"test -f /tmp/file2\"]
This will only run the exec if /all/ conditions in the array return true.
"
@@ -683,4 +683,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 71f2756bc..f35a26408 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -16,7 +16,7 @@ Puppet::Type.newtype(:file) do
@doc = "Manages local files, including setting ownership and
permissions, creation of both files and directories, and
retrieving entire files from remote servers. As Puppet matures, it
- expected that the ``file`` resource will be used less and less to
+ expected that the `file` resource will be used less and less to
manage content, and instead native resources will be used to do so.
If you find that you are often copying files in from a central
@@ -61,33 +61,33 @@ Puppet::Type.newtype(:file) do
newparam(:backup) do
desc "Whether files should be backed up before
being replaced. The preferred method of backing files up is via
- a ``filebucket``, which stores files by their MD5 sums and allows
+ a `filebucket`, which stores files by their MD5 sums and allows
easy retrieval without littering directories with backups. You
can specify a local filebucket or a network-accessible
- server-based filebucket by setting ``backup => bucket-name``.
- Alternatively, if you specify any value that begins with a ``.``
- (e.g., ``.puppet-bak``), then Puppet will use copy the file in
+ server-based filebucket by setting `backup => bucket-name`.
+ Alternatively, if you specify any value that begins with a `.`
+ (e.g., `.puppet-bak`), then Puppet will use copy the file in
the same directory with that value as the extension of the
- backup. Setting ``backup => false`` disables all backups of the
+ backup. Setting `backup => false` disables all backups of the
file in question.
- Puppet automatically creates a local filebucket named ``puppet`` and
+ Puppet automatically creates a local filebucket named `puppet` and
defaults to backing up there. To use a server-based filebucket,
- you must specify one in your configuration::
+ you must specify one in your configuration
- filebucket { main:
- server => puppet
- }
+ filebucket { main:
+ server => puppet
+ }
- The ``puppet master`` daemon creates a filebucket by default,
+ The `puppet master` daemon creates a filebucket by default,
so you can usually back up to your main server with this
configuration. Once you've described the bucket in your
- configuration, you can use it in any file::
+ configuration, you can use it in any file
- file { \"/my/file\":
- source => \"/path/in/nfs/or/something\",
- backup => main
- }
+ file { \"/my/file\":
+ source => \"/path/in/nfs/or/something\",
+ backup => main
+ }
This will back the file up to the central server.
@@ -192,9 +192,9 @@ Puppet::Type.newtype(:file) do
newparam(:ignore) do
desc "A parameter which omits action on files matching
specified patterns during recursion. Uses Ruby's builtin globbing
- engine, so shell metacharacters are fully supported, e.g. ``[a-z]*``.
+ engine, so shell metacharacters are fully supported, e.g. `[a-z]*`.
Matches that would descend into the directory structure are ignored,
- e.g., ``*/*``."
+ e.g., `*/*`."
validate do |value|
unless value.is_a?(Array) or value.is_a?(String) or value == false
@@ -205,10 +205,10 @@ Puppet::Type.newtype(:file) do
newparam(:links) do
desc "How to handle links during file actions. During file copying,
- ``follow`` will copy the target file instead of the link, ``manage``
- will copy the link itself, and ``ignore`` will just pass it by.
- When not copying, ``manage`` and ``ignore`` behave equivalently
- (because you cannot really ignore links entirely during local recursion), and ``follow`` will manage the file to which the
+ `follow` will copy the target file instead of the link, `manage`
+ will copy the link itself, and `ignore` will just pass it by.
+ When not copying, `manage` and `ignore` behave equivalently
+ (because you cannot really ignore links entirely during local recursion), and `follow` will manage the file to which the
link points."
newvalues(:follow, :manage)
@@ -223,7 +223,7 @@ Puppet::Type.newtype(:file) do
files unless you really know what you are doing. This option only
makes sense when recursively managing directories.
- Note that when using ``purge`` with ``source``, Puppet will purge any files
+ Note that when using `purge` with `source`, Puppet will purge any files
that are not on the remote system."
defaultto :false
@@ -234,7 +234,7 @@ Puppet::Type.newtype(:file) do
newparam(:sourceselect) do
desc "Whether to copy all valid sources, or just the first one. This parameter
is only used in recursive copies; by default, the first valid source is the
- only one used as a recursive source, but if this parameter is set to ``all``,
+ only one used as a recursive source, but if this parameter is set to `all`,
then all valid sources will have all of their contents copied to the local host,
and for sources that have the same file, the source earlier in the list will
be used."
diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb
index c74a1d47a..967e06aee 100755
--- a/lib/puppet/type/file/ensure.rb
+++ b/lib/puppet/type/file/ensure.rb
@@ -3,27 +3,27 @@ module Puppet
require 'etc'
desc "Whether to create files that don't currently exist.
Possible values are *absent*, *present*, *file*, and *directory*.
- Specifying ``present`` will match any form of file existence, and
+ Specifying `present` will match any form of file existence, and
if the file is missing will create an empty file. Specifying
- ``absent`` will delete the file (and directory if recurse => true).
+ `absent` will delete the file (and directory if recurse => true).
Anything other than those values will be considered to be a symlink.
- For instance, the following text creates a link::
+ For instance, the following text creates a link:
- # Useful on solaris
- file { \"/etc/inetd.conf\":
- ensure => \"/etc/inet/inetd.conf\"
- }
+ # Useful on solaris
+ file { \"/etc/inetd.conf\":
+ ensure => \"/etc/inet/inetd.conf\"
+ }
- You can make relative links::
+ You can make relative links:
- # Useful on solaris
- file { \"/etc/inetd.conf\":
- ensure => \"inet/inetd.conf\"
- }
+ # Useful on solaris
+ file { \"/etc/inetd.conf\":
+ ensure => \"inet/inetd.conf\"
+ }
If you need to make a relative link to a file named the same
- as one of the valid values, you must prefix it with ``./`` or
+ as one of the valid values, you must prefix it with `./` or
something similar.
You can also make recursive symlinks, which will create a
diff --git a/lib/puppet/type/file/mode.rb b/lib/puppet/type/file/mode.rb
index 9abf56d26..1ce56c843 100755
--- a/lib/puppet/type/file/mode.rb
+++ b/lib/puppet/type/file/mode.rb
@@ -13,14 +13,14 @@ module Puppet
entries in a directory, and search/traverse allows you to access
(read/write/execute) those entries.) Because of this feature, you
can recursively make a directory and all of the files in it
- world-readable by setting e.g.::
+ world-readable by setting e.g.:
- file { '/some/dir':
- mode => 644,
- recurse => true,
- }
+ file { '/some/dir':
+ mode => 644,
+ recurse => true,
+ }
- In this case all of the files underneath ``/some/dir`` will have
+ In this case all of the files underneath `/some/dir` will have
mode 644, and all of the directories will have mode 755."
@event = :file_changed
diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb
index edcfb83b2..a33c6a000 100644
--- a/lib/puppet/type/file/selcontext.rb
+++ b/lib/puppet/type/file/selcontext.rb
@@ -56,7 +56,7 @@ module Puppet
Puppet::Type.type(:file).newproperty(:seluser, :parent => Puppet::SELFileContext) do
desc "What the SELinux user component of the context of the file should be.
- Any valid SELinux user component is accepted. For example ``user_u``.
+ Any valid SELinux user component is accepted. For example `user_u`.
If not specified it defaults to the value returned by matchpathcon for
the file, if any exists. Only valid on systems with SELinux support
enabled."
@@ -67,7 +67,7 @@ module Puppet
Puppet::Type.type(:file).newproperty(:selrole, :parent => Puppet::SELFileContext) do
desc "What the SELinux role component of the context of the file should be.
- Any valid SELinux role component is accepted. For example ``role_r``.
+ Any valid SELinux role component is accepted. For example `role_r`.
If not specified it defaults to the value returned by matchpathcon for
the file, if any exists. Only valid on systems with SELinux support
enabled."
@@ -78,7 +78,7 @@ module Puppet
Puppet::Type.type(:file).newproperty(:seltype, :parent => Puppet::SELFileContext) do
desc "What the SELinux type component of the context of the file should be.
- Any valid SELinux type component is accepted. For example ``tmp_t``.
+ Any valid SELinux type component is accepted. For example `tmp_t`.
If not specified it defaults to the value returned by matchpathcon for
the file, if any exists. Only valid on systems with SELinux support
enabled."
@@ -89,8 +89,8 @@ module Puppet
Puppet::Type.type(:file).newproperty(:selrange, :parent => Puppet::SELFileContext) do
desc "What the SELinux range component of the context of the file should be.
- Any valid SELinux range component is accepted. For example ``s0`` or
- ``SystemHigh``. If not specified it defaults to the value returned by
+ Any valid SELinux range component is accepted. For example `s0` or
+ `SystemHigh`. If not specified it defaults to the value returned by
matchpathcon for the file, if any exists. Only valid on systems with
SELinux support enabled and that have support for MCS (Multi-Category
Security)."
diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb
index 2eaf4a33f..0e7aac72d 100755
--- a/lib/puppet/type/file/source.rb
+++ b/lib/puppet/type/file/source.rb
@@ -12,7 +12,7 @@ module Puppet
include Puppet::Util::Diff
attr_accessor :source, :local
- desc "Copy a file over the current file. Uses ``checksum`` to
+ desc "Copy a file over the current file. Uses `checksum` to
determine when a file should be copied. Valid values are either
fully qualified paths to files, or URIs. Currently supported URI
types are *puppet* and *file*.
@@ -20,47 +20,47 @@ module Puppet
This is one of the primary mechanisms for getting content into
applications that Puppet does not directly support and is very
useful for those configuration files that don't change much across
- sytems. For instance::
+ sytems. For instance:
- class sendmail {
- file { \"/etc/mail/sendmail.cf\":
- source => \"puppet://server/modules/module_name/sendmail.cf\"
+ class sendmail {
+ file { \"/etc/mail/sendmail.cf\":
+ source => \"puppet://server/modules/module_name/sendmail.cf\"
+ }
}
- }
- You can also leave out the server name, in which case ``puppet agent``
- will fill in the name of its configuration server and ``puppet apply``
+ You can also leave out the server name, in which case `puppet agent`
+ will fill in the name of its configuration server and `puppet apply`
will use the local filesystem. This makes it easy to use the same
configuration in both local and centralized forms.
- Currently, only the ``puppet`` scheme is supported for source
+ Currently, only the `puppet` scheme is supported for source
URL's. Puppet will connect to the file server running on
- ``server`` to retrieve the contents of the file. If the
- ``server`` part is empty, the behavior of the command-line
- interpreter (``puppet apply``) and the client demon (``puppet agent``) differs
- slightly: ``apply`` will look such a file up on the module path
- on the local host, whereas ``agent`` will connect to the
+ `server` to retrieve the contents of the file. If the
+ `server` part is empty, the behavior of the command-line
+ interpreter (`puppet apply`) and the client demon (`puppet agent`) differs
+ slightly: `apply` will look such a file up on the module path
+ on the local host, whereas `agent` will connect to the
puppet server that it received the manifest from.
- See the `FileServingConfiguration fileserver configuration documentation`:trac: for information on how to configure
+ See the [fileserver configuration documentation](http://projects.puppetlabs.com/projects/puppet/wiki/File_Serving_Configuration) for information on how to configure
and use file services within Puppet.
If you specify multiple file sources for a file, then the first
source that exists will be used. This allows you to specify
- what amount to search paths for files::
-
- file { \"/path/to/my/file\":
- source => [
- \"/modules/nfs/files/file.$host\",
- \"/modules/nfs/files/file.$operatingsystem\",
- \"/modules/nfs/files/file\"
- ]
- }
+ what amount to search paths for files:
+
+ file { \"/path/to/my/file\":
+ source => [
+ \"/modules/nfs/files/file.$host\",
+ \"/modules/nfs/files/file.$operatingsystem\",
+ \"/modules/nfs/files/file\"
+ ]
+ }
This will use the first found file as the source.
- You cannot currently copy links using this mechanism; set ``links``
- to ``follow`` if any remote sources are links.
+ You cannot currently copy links using this mechanism; set `links`
+ to `follow` if any remote sources are links.
"
validate do |sources|
diff --git a/lib/puppet/type/filebucket.rb b/lib/puppet/type/filebucket.rb
index 65ff88411..7fd2ef46b 100755
--- a/lib/puppet/type/filebucket.rb
+++ b/lib/puppet/type/filebucket.rb
@@ -16,13 +16,13 @@ module Puppet
undo transactions.
You will normally want to define a single filebucket for your
- whole network and then use that as the default backup location::
+ whole network and then use that as the default backup location:
- # Define the bucket
- filebucket { main: server => puppet }
+ # Define the bucket
+ filebucket { main: server => puppet }
- # Specify it as the default target
- File { backup => main }
+ # Specify it as the default target
+ File { backup => main }
Puppetmaster servers create a filebucket by default, so this will
work in a default configuration."
@@ -92,4 +92,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/group.rb b/lib/puppet/type/group.rb
index 9f26d2243..cde1cfd65 100755
--- a/lib/puppet/type/group.rb
+++ b/lib/puppet/type/group.rb
@@ -89,7 +89,7 @@ module Puppet
newparam(:allowdupe, :boolean => true) do
desc "Whether to allow duplicate GIDs. This option does not work on
- FreeBSD (contract to the ``pw`` man page)."
+ FreeBSD (contract to the `pw` man page)."
newvalues(:true, :false)
@@ -97,4 +97,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/host.rb b/lib/puppet/type/host.rb
index 929542d7c..8ab750459 100755
--- a/lib/puppet/type/host.rb
+++ b/lib/puppet/type/host.rb
@@ -14,10 +14,8 @@ module Puppet
end
newproperty(:host_aliases) do
- desc 'Any aliases the host might have. Multiple values must be
- specified as an array. Note that this property is not the same as
- the "alias" metaparam; use this property to add aliases to a host
- on disk, and "alias" to aliases for use in your Puppet scripts.'
+ desc "Any aliases the host might have. Multiple values must be
+ specified as an array."
def insync?(is)
is == @should
@@ -94,8 +92,7 @@ module Puppet
end
@doc = "Installs and manages host entries. For most systems, these
- entries will just be in ``/etc/hosts``, but some systems (notably OS X)
+ entries will just be in `/etc/hosts`, but some systems (notably OS X)
will have different solutions."
end
end
-
diff --git a/lib/puppet/type/k5login.rb b/lib/puppet/type/k5login.rb
index 850e37733..a343e9e5c 100644
--- a/lib/puppet/type/k5login.rb
+++ b/lib/puppet/type/k5login.rb
@@ -3,15 +3,15 @@
# Plug-in type for handling k5login files
Puppet::Type.newtype(:k5login) do
- @doc = "Manage the .k5login file for a user. Specify the full path to
- the .k5login file as the name and an array of principals as the
+ @doc = "Manage the `.k5login` file for a user. Specify the full path to
+ the `.k5login` file as the name and an array of principals as the
property principals."
ensurable
# Principals that should exist in the file
newproperty(:principals, :array_matching => :all) do
- desc "The principals present in the .k5login file."
+ desc "The principals present in the `.k5login` file."
end
# The path/name of the k5login file
diff --git a/lib/puppet/type/macauthorization.rb b/lib/puppet/type/macauthorization.rb
index 9b17c279d..ef6fbb6c1 100644
--- a/lib/puppet/type/macauthorization.rb
+++ b/lib/puppet/type/macauthorization.rb
@@ -1,8 +1,7 @@
Puppet::Type.newtype(:macauthorization) do
@doc = "Manage the Mac OS X authorization database.
- See:
- http://developer.apple.com/documentation/Security/Conceptual/Security_Overview/Security_Services/chapter_4_section_5.html for more information."
+ See the [Apple developer site](http://developer.apple.com/documentation/Security/Conceptual/Security_Overview/Security_Services/chapter_4_section_5.html) for more information."
ensurable
diff --git a/lib/puppet/type/mailalias.rb b/lib/puppet/type/mailalias.rb
index 5534fdf25..ce7ca790b 100755
--- a/lib/puppet/type/mailalias.rb
+++ b/lib/puppet/type/mailalias.rb
@@ -46,4 +46,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/maillist.rb b/lib/puppet/type/maillist.rb
index 7ac0e4e4f..732fbf09f 100755
--- a/lib/puppet/type/maillist.rb
+++ b/lib/puppet/type/maillist.rb
@@ -60,4 +60,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/mcx.rb b/lib/puppet/type/mcx.rb
index e56b11938..4f0a6c3c5 100644
--- a/lib/puppet/type/mcx.rb
+++ b/lib/puppet/type/mcx.rb
@@ -21,8 +21,6 @@ Puppet::Type.newtype(:mcx) do
@doc = "MCX object management using DirectoryService on OS X.
-Original Author: Jeff McCune <mccune.jeff@gmail.com>
-
The default provider of this type merely manages the XML plist as
reported by the dscl -mcxexport command. This is similar to the
content property of the file type in Puppet.
@@ -51,13 +49,13 @@ to other machines.
newparam(:name) do
desc "The name of the resource being managed.
- The default naming convention follows Directory Service paths::
+ The default naming convention follows Directory Service paths:
- /Computers/localhost
- /Groups/admin
- /Users/localadmin
+ /Computers/localhost
+ /Groups/admin
+ /Users/localadmin
- The ds_type and ds_name type parameters are not necessary if the
+ The `ds_type` and `ds_name` type parameters are not necessary if the
default naming convention is followed."
isnamevar
end
@@ -80,8 +78,10 @@ to other machines.
newproperty(:content, :required_features => :manages_content) do
desc "The XML Plist. The value of MCXSettings in DirectoryService.
This is the standard output from the system command:
- dscl localhost -mcxexport /Local/Default/<ds_type>/ds_name
- Note that ds_type is capitalized and plural in the dscl command."
+
+ dscl localhost -mcxexport /Local/Default/<ds_type>/ds_name
+
+ Note that `ds_type` is capitalized and plural in the dscl command."
end
# JJM Yes, this is not DRY at all. Because of the code blocks
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index 6ee5dd174..d048c90f1 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -5,8 +5,8 @@ module Puppet
information into the mount table. The actual behavior depends
on the value of the 'ensure' parameter.
- Note that if a ``mount`` receives an event from another resource,
- it will try to remount the filesystems if ``ensure`` is set to ``mounted``."
+ Note that if a `mount` receives an event from another resource,
+ it will try to remount the filesystems if `ensure` is set to `mounted`."
feature :refreshable, "The provider can remount the filesystem.",
:methods => [:remount]
@@ -15,10 +15,10 @@ module Puppet
# call code when sync is called.
newproperty(:ensure) do
desc "Control what to do with this mount. Set this attribute to
- ``umounted`` to make sure the filesystem is in the filesystem table
- but not mounted (if the filesystem is currently mounted, it will be unmounted). Set it to ``absent`` to unmount (if necessary) and remove
- the filesystem from the fstab. Set to ``mounted`` to add it to the
- fstab and mount it. Set to ``present`` to add to fstab but not change
+ `umounted` to make sure the filesystem is in the filesystem table
+ but not mounted (if the filesystem is currently mounted, it will be unmounted). Set it to `absent` to unmount (if necessary) and remove
+ the filesystem from the fstab. Set to `mounted` to add it to the
+ fstab and mount it. Set to `present` to add to fstab but not change
mount/unmount status"
newvalue(:defined) do
@@ -149,7 +149,7 @@ module Puppet
newproperty(:dump) do
desc "Whether to dump the mount. Not all platform support this.
- Valid values are ``1`` or ``0``. or ``2`` on FreeBSD, Default is ``0``."
+ Valid values are `1` or `0`. or `2` on FreeBSD, Default is `0`."
if Facter["operatingsystem"].value == "FreeBSD"
newvalue(%r{(0|1|2)})
@@ -183,7 +183,7 @@ module Puppet
end
newparam(:path) do
- desc "The deprecated name for the mount point. Please use ``name`` now."
+ desc "The deprecated name for the mount point. Please use `name` now."
def value=(value)
warning "'path' is deprecated for mounts. Please use 'name'."
@@ -193,7 +193,7 @@ module Puppet
end
newparam(:remounts) do
- desc "Whether the mount can be remounted ``mount -o remount``. If
+ desc "Whether the mount can be remounted `mount -o remount`. If
this is false, then the filesystem will be unmounted and remounted
manually, which is prone to failure."
@@ -222,4 +222,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/notify.rb b/lib/puppet/type/notify.rb
index 97935e270..a6ec1dc8b 100644
--- a/lib/puppet/type/notify.rb
+++ b/lib/puppet/type/notify.rb
@@ -42,4 +42,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb
index f25464db5..51a866332 100644
--- a/lib/puppet/type/package.rb
+++ b/lib/puppet/type/package.rb
@@ -8,12 +8,12 @@ module Puppet
@doc = "Manage packages. There is a basic dichotomy in package
support right now: Some package types (e.g., yum and apt) can
retrieve their own package files, while others (e.g., rpm and sun) cannot. For those package formats that cannot retrieve
- their own files, you can use the ``source`` parameter to point to
+ their own files, you can use the `source` parameter to point to
the correct file.
Puppet will automatically guess the packaging format that you are
using based on the platform you are on, but you can override it
- using the ``provider`` parameter; each provider defines what it
+ using the `provider` parameter; each provider defines what it
requires in order to function, and you must meet those requirements
to use a given provider."
@@ -22,7 +22,7 @@ module Puppet
feature :uninstallable, "The provider can uninstall packages.",
:methods => [:uninstall]
feature :upgradeable, "The provider can upgrade to the latest version of a
- package. This feature is used by specifying ``latest`` as the
+ package. This feature is used by specifying `latest` as the
desired value for the package.",
:methods => [:update, :latest]
feature :purgeable, "The provider can purge packages. This generally means
@@ -104,7 +104,6 @@ module Puppet
end
end
-
defaultto :installed
# Override the parent method, because we've got all kinds of
@@ -181,35 +180,35 @@ module Puppet
system uses internally, which is sometimes (especially on Solaris)
a name that is basically useless to humans. If you want to
abstract package installation, then you can use aliases to provide
- a common name to packages::
-
- # In the 'openssl' class
- $ssl = $operatingsystem ? {
- solaris => SMCossl,
- default => openssl
- }
-
- # It is not an error to set an alias to the same value as the
- # object name.
- package { $ssl:
- ensure => installed,
- alias => openssl
- }
-
- . etc. .
-
- $ssh = $operatingsystem ? {
- solaris => SMCossh,
- default => openssh
- }
-
- # Use the alias to specify a dependency, rather than
- # having another selector to figure it out again.
- package { $ssh:
- ensure => installed,
- alias => openssh,
- require => Package[openssl]
- }
+ a common name to packages:
+
+ # In the 'openssl' class
+ $ssl = $operatingsystem ? {
+ solaris => SMCossl,
+ default => openssl
+ }
+
+ # It is not an error to set an alias to the same value as the
+ # object name.
+ package { $ssl:
+ ensure => installed,
+ alias => openssl
+ }
+
+ . etc. .
+
+ $ssh = $operatingsystem ? {
+ solaris => SMCossh,
+ default => openssh
+ }
+
+ # Use the alias to specify a dependency, rather than
+ # having another selector to figure it out again.
+ package { $ssh:
+ ensure => installed,
+ alias => openssh,
+ require => Package[openssl]
+ }
"
isnamevar
@@ -228,7 +227,7 @@ module Puppet
end
newparam(:type) do
- desc "Deprecated form of ``provider``."
+ desc "Deprecated form of `provider`."
munge do |value|
warning "'type' is deprecated; use 'provider' instead"
@@ -243,7 +242,7 @@ module Puppet
This is currently only used on Solaris. The value will be
validated according to system rules, which in the case of
Solaris means that it should either be a fully qualified path
- or it should be in /var/sadm/install/admin."
+ or it should be in `/var/sadm/install/admin`."
end
newparam(:responsefile) do
@@ -320,4 +319,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/resources.rb b/lib/puppet/type/resources.rb
index 34382e067..ae41b883b 100644
--- a/lib/puppet/type/resources.rb
+++ b/lib/puppet/type/resources.rb
@@ -1,12 +1,9 @@
-# Created by Luke Kanies on 2006-12-12.
-# Copyright (c) 2006. All rights reserved.
-
require 'puppet'
Puppet::Type.newtype(:resources) do
@doc = "This is a metatype that can manage other resource types. Any
metaparams specified here will be passed on to any generated resources,
- so you can purge umanaged resources but set ``noop`` to true so the
+ so you can purge umanaged resources but set `noop` to true so the
purging is only logged and does not actually happen."
@@ -132,4 +129,3 @@ Puppet::Type.newtype(:resources) do
%w{root nobody bin noaccess daemon sys}
end
end
-
diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb
index bedf1e536..ff3fba8eb 100755
--- a/lib/puppet/type/schedule.rb
+++ b/lib/puppet/type/schedule.rb
@@ -196,17 +196,17 @@ module Puppet
Note that the period defines how often a given resource will get
applied but not when; if you would like to restrict the hours
that a given resource can be applied (e.g., only at night during
- a maintenance window) then use the ``range`` attribute.
+ a maintenance window) then use the `range` attribute.
If the provided periods are not sufficient, you can provide a
value to the *repeat* attribute, which will cause Puppet to
schedule the affected resources evenly in the period the
- specified number of times. Take this schedule::
+ specified number of times. Take this schedule:
- schedule { veryoften:
- period => hourly,
- repeat => 6
- }
+ schedule { veryoften:
+ period => hourly,
+ repeat => 6
+ }
This can cause Puppet to apply that resource up to every 10 minutes.
@@ -215,7 +215,7 @@ module Puppet
internal factors might prevent it from actually running that
often (e.g., long-running Puppet runs will squash conflictingly scheduled runs).
- See the ``periodmatch`` attribute for tuning whether to match
+ See the `periodmatch` attribute for tuning whether to match
times by their distance apart or by their specific value."
newvalues(:hourly, :daily, :weekly, :monthly, :never)
@@ -307,10 +307,10 @@ module Puppet
Puppet.debug "Creating default schedules"
result << self.new(
-
+
:name => "puppet",
:period => :hourly,
-
+
:repeat => "2"
)
@@ -318,9 +318,7 @@ module Puppet
@parameters.find { |p| p.name == :period }.value_collection.values.each { |value|
result << self.new(
-
:name => value.to_s,
-
:period => value
)
}
@@ -349,4 +347,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/selboolean.rb b/lib/puppet/type/selboolean.rb
index cf873e987..204b89056 100644
--- a/lib/puppet/type/selboolean.rb
+++ b/lib/puppet/type/selboolean.rb
@@ -1,11 +1,7 @@
-#
-# Simple module for manageing SELinux booleans
-#
-
module Puppet
newtype(:selboolean) do
@doc = "Manages SELinux booleans on systems with SELinux support. The supported booleans
- are any of the ones found in /selinux/booleans/."
+ are any of the ones found in `/selinux/booleans/`."
newparam(:name) do
desc "The name of the SELinux boolean to be managed."
@@ -20,7 +16,7 @@ module Puppet
newparam(:persistent) do
desc "If set true, SELinux booleans will be written to disk and persist accross reboots.
- The default is ``false``."
+ The default is `false`."
defaultto :false
newvalues(:true, :false)
@@ -28,4 +24,3 @@ module Puppet
end
end
-
diff --git a/lib/puppet/type/selmodule.rb b/lib/puppet/type/selmodule.rb
index 240d6e6d1..60be8a855 100644
--- a/lib/puppet/type/selmodule.rb
+++ b/lib/puppet/type/selmodule.rb
@@ -18,7 +18,7 @@ Puppet::Type.newtype(:selmodule) do
newparam(:selmoduledir) do
desc "The directory to look for the compiled pp module file in.
- Currently defaults to /usr/share/selinux/targeted. If selmodulepath
+ Currently defaults to `/usr/share/selinux/targeted`. If selmodulepath
is not specified the module will be looked for in this directory in a
in a file called NAME.pp, where NAME is the value of the name parameter."
@@ -34,9 +34,9 @@ Puppet::Type.newtype(:selmodule) do
newproperty(:syncversion) do
- desc "If set to ``true``, the policy will be reloaded if the
+ desc "If set to `true`, the policy will be reloaded if the
version found in the on-disk file differs from the loaded
- version. If set to ``false`` (the default) the the only check
+ version. If set to `false` (the default) the the only check
that will be made is if the policy is loaded at all or not."
newvalue(:true)
@@ -51,4 +51,3 @@ Puppet::Type.newtype(:selmodule) do
end
end
end
-
diff --git a/lib/puppet/type/service.rb b/lib/puppet/type/service.rb
index 8f5c6ee37..c00f02789 100644
--- a/lib/puppet/type/service.rb
+++ b/lib/puppet/type/service.rb
@@ -17,10 +17,10 @@ module Puppet
can provide the better behaviour you will get. Or, you can just
use a platform that has very good service support.
- Note that if a ``service`` receives an event from another resource,
+ Note that if a `service` receives an event from another resource,
the service will get restarted. The actual command to restart the
service depends on the platform. You can provide a special command
- for restarting with the ``restart`` attribute."
+ for restarting with the `restart` attribute."
feature :refreshable, "The provider can restart the service.",
:methods => [:restart]
@@ -83,7 +83,7 @@ module Puppet
newparam(:binary) do
desc "The path to the daemon. This is only used for
systems that do not support init scripts. This binary will be
- used to start the service if no ``start`` parameter is
+ used to start the service if no `start` parameter is
provided."
end
@@ -94,7 +94,7 @@ module Puppet
not support any kind of status command; thus, you must specify
manually whether the service you are running has such a
command (or you can specify a specific command using the
- ``status`` parameter).
+ `status` parameter).
If you do not specify anything, then the service name will be
looked for in the process table."
@@ -140,7 +140,7 @@ module Puppet
end
newparam(:start) do
desc "Specify a *start* command manually. Most service subsystems
- support a ``start`` command, so this will not need to be
+ support a `start` command, so this will not need to be
specified."
end
newparam(:status) do
@@ -156,14 +156,14 @@ module Puppet
newparam(:control) do
desc "The control variable used to manage services (originally for HP-UX).
- Defaults to the upcased service name plus ``START`` replacing dots with
- underscores, for those providers that support the ``controllable`` feature."
+ Defaults to the upcased service name plus `START` replacing dots with
+ underscores, for those providers that support the `controllable` feature."
defaultto { resource.name.gsub(".","_").upcase + "_START" if resource.provider.controllable? }
end
newparam :hasrestart do
- desc "Specify that an init script has a ``restart`` option. Otherwise,
- the init script's ``stop`` and ``start`` methods are used."
+ desc "Specify that an init script has a `restart` option. Otherwise,
+ the init script's `stop` and `start` methods are used."
newvalues(:true, :false)
end
diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb
index 2bfa87b0f..e3320140e 100644
--- a/lib/puppet/type/ssh_authorized_key.rb
+++ b/lib/puppet/type/ssh_authorized_key.rb
@@ -34,8 +34,8 @@ module Puppet
newproperty(:target) do
desc "The absolute filename in which to store the SSH key. This
property is optional and should only be used in cases where keys
- are stored in a non-standard location (ie not in
- ~user/.ssh/authorized_keys)."
+ are stored in a non-standard location (i.e.` not in
+ `~user/.ssh/authorized_keys`)."
defaultto :absent
@@ -96,4 +96,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/sshkey.rb b/lib/puppet/type/sshkey.rb
index e1adc7173..b7a1b8a8d 100755
--- a/lib/puppet/type/sshkey.rb
+++ b/lib/puppet/type/sshkey.rb
@@ -1,8 +1,8 @@
module Puppet
newtype(:sshkey) do
@doc = "Installs and manages ssh host keys. At this point, this type
- only knows how to install keys into /etc/ssh/ssh_known_hosts, and
- it cannot manage user authorized keys yet."
+ only knows how to install keys into `/etc/ssh/ssh_known_hosts`. See
+ the `ssh_authorized_key` type to manage authorized keys."
ensurable
@@ -23,9 +23,7 @@ module Puppet
# to see if we can automatically glean any aliases.
newproperty(:host_aliases) do
desc 'Any aliases the host might have. Multiple values must be
- specified as an array. Note that this property is not the same as
- the "alias" metaparam; use this property to add aliases to a host
- on disk, and "alias" to aliases for use in your Puppet scripts.'
+ specified as an array.'
attr_accessor :meta
@@ -56,7 +54,7 @@ module Puppet
newproperty(:target) do
desc "The file in which to store the ssh key. Only used by
- the ``parsed`` provider."
+ the `parsed` provider."
defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
@resource.class.defaultprovider.default_target
@@ -67,4 +65,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/stage.rb b/lib/puppet/type/stage.rb
index d22cd7b70..0736dc4b9 100644
--- a/lib/puppet/type/stage.rb
+++ b/lib/puppet/type/stage.rb
@@ -1,11 +1,12 @@
Puppet::Type.newtype(:stage) do
desc "A resource type for specifying run stages. The actual stage should
- be specified on resources::
- class { foo: stage => pre }
+ be specified on resources:
+
+ class { foo: stage => pre }
- And you must manually control stage order::
+ And you must manually control stage order:
- stage { pre: before => Stage[main] }
+ stage { pre: before => Stage[main] }
You automatically get a 'main' stage created, and by default all resources
get inserted into that stage.
diff --git a/lib/puppet/type/tidy.rb b/lib/puppet/type/tidy.rb
index a6605211e..64a7a1a88 100755
--- a/lib/puppet/type/tidy.rb
+++ b/lib/puppet/type/tidy.rb
@@ -5,7 +5,7 @@ Puppet::Type.newtype(:tidy) do
criteria are OR'd together, so a file that is too large but is not
old enough will still get tidied.
- If you don't specify either 'age' or 'size', then all files will
+ If you don't specify either `age` or `size`, then all files will
be removed.
This resource type works by generating a file resource for every file
@@ -47,7 +47,7 @@ Puppet::Type.newtype(:tidy) do
at least one of the patterns specified. Multiple patterns can
be specified using an array.
- Example::
+ Example:
tidy { \"/tmp\":
age => \"1w\",
@@ -55,7 +55,7 @@ Puppet::Type.newtype(:tidy) do
matches => [ \"[0-9]pub*.tmp\", \"*.temp\", \"tmpfile?\" ]
}
- This removes files from \/tmp if they are one week old or older,
+ This removes files from `/tmp` if they are one week old or older,
are not in a subdirectory and match one of the shell globs given.
Note that the patterns are matched against the basename of each
diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index c7ac796a3..007b760bc 100755
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -12,7 +12,7 @@ module Puppet
This resource type uses the prescribed native tools for creating
groups and generally uses POSIX APIs for retrieving information
- about them. It does not directly modify /etc/passwd or anything."
+ about them. It does not directly modify `/etc/passwd` or anything."
feature :allows_duplicates,
"The provider supports duplicate users with the same UID."
@@ -381,4 +381,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb
index 5d86b1c75..698c077f4 100644
--- a/lib/puppet/type/yumrepo.rb
+++ b/lib/puppet/type/yumrepo.rb
@@ -52,8 +52,9 @@ module Puppet
newtype(:yumrepo) do
@doc = "The client-side description of a yum repository. Repository
- configurations are found by parsing /etc/yum.conf and
- the files indicated by reposdir in that file (see yum.conf(5) for details)
+ configurations are found by parsing `/etc/yum.conf` and
+ the files indicated by the `reposdir` option in that file
+ (see yum.conf(5) for details)
Most parameters are identical to the ones documented
in yum.conf(5)
diff --git a/lib/puppet/type/zfs.rb b/lib/puppet/type/zfs.rb
index e1a972ddf..1757931f8 100755
--- a/lib/puppet/type/zfs.rb
+++ b/lib/puppet/type/zfs.rb
@@ -33,7 +33,7 @@ module Puppet
end
newproperty(:snapdir) do
- desc "The sharenfs property."
+ desc "The snapdir property."
end
autorequire(:zpool) do
@@ -48,4 +48,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index d523c469a..408d6f5dd 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -69,9 +69,9 @@ Puppet::Type.newtype(:zone) do
ensurable do
desc "The running state of the zone. The valid states directly reflect
- the states that ``zoneadm`` provides. The states are linear,
- in that a zone must be ``configured`` then ``installed``, and
- only then can be ``running``. Note also that ``halt`` is currently
+ the states that `zoneadm` provides. The states are linear,
+ in that a zone must be `configured` then `installed`, and
+ only then can be `running`. Note also that `halt` is currently
used to stop zones."
@states = {}
@@ -313,31 +313,31 @@ Puppet::Type.newtype(:zone) do
# only used to boot the zone the very first time.
newparam(:sysidcfg) do
desc %{The text to go into the sysidcfg file when the zone is first
- booted. The best way is to use a template::
-
- # $templatedir/sysidcfg
- system_locale=en_US
- timezone=GMT
- terminal=xterms
- security_policy=NONE
- root_password=&lt;%= password %>
- timeserver=localhost
- 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=&lt;%= defaultroute %>}
- nfs4_domain=dynamic
-
- And then call that::
-
- zone { myzone:
- ip => "bge0:192.168.0.23",
- sysidcfg => template(sysidcfg),
- path => "/opt/zones/myzone",
- realhostname => "fully.qualified.domain.name"
- }
+ booted. The best way is to use a template:
+
+ # $templatedir/sysidcfg
+ system_locale=en_US
+ timezone=GMT
+ terminal=xterms
+ security_policy=NONE
+ root_password=<%= password %>
+ timeserver=localhost
+ name_service=DNS {domain_name=<%= domain %> name_server=<%= nameserver %>}
+ network_interface=primary {hostname=<%= realhostname %>
+ ip_address=<%= ip %>
+ netmask=<%= netmask %>
+ protocol_ipv6=no
+ default_route=<%= defaultroute %>}
+ nfs4_domain=dynamic
+
+ And then call that:
+
+ zone { myzone:
+ ip => "bge0:192.168.0.23",
+ sysidcfg => template(sysidcfg),
+ path => "/opt/zones/myzone",
+ realhostname => "fully.qualified.domain.name"
+ }
The sysidcfg only matters on the first booting of the zone,
so Puppet only checks for it at that time.}
diff --git a/lib/puppet/type/zpool.rb b/lib/puppet/type/zpool.rb
index 80e635504..49cce552a 100755
--- a/lib/puppet/type/zpool.rb
+++ b/lib/puppet/type/zpool.rb
@@ -44,8 +44,11 @@ module Puppet
end
newproperty(:mirror, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do
- desc "List of all the devices to mirror for this pool. Each mirror should be a space separated string.
- mirror => [\"disk1 disk2\", \"disk3 disk4\"]"
+ desc "List of all the devices to mirror for this pool. Each mirror should be a space separated string:
+
+ mirror => [\"disk1 disk2\", \"disk3 disk4\"]
+
+ "
validate do |value|
raise ArgumentError, "mirror names must be provided as string separated, not a comma-separated list" if value.include?(",")
@@ -53,8 +56,11 @@ module Puppet
end
newproperty(:raidz, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do
- desc "List of all the devices to raid for this pool. Should be an array of space separated strings.
- raidz => [\"disk1 disk2\", \"disk3 disk4\"]"
+ desc "List of all the devices to raid for this pool. Should be an array of space separated strings:
+
+ raidz => [\"disk1 disk2\", \"disk3 disk4\"]
+
+ "
validate do |value|
raise ArgumentError, "raid names must be provided as string separated, not a comma-separated list" if value.include?(",")
@@ -84,4 +90,3 @@ module Puppet
end
end
end
-
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb
index c293ac14a..f0dd0a5c5 100644
--- a/lib/puppet/util/autoload.rb
+++ b/lib/puppet/util/autoload.rb
@@ -131,11 +131,23 @@ class Puppet::Util::Autoload
# We have to require this late in the process because otherwise we might have
# load order issues.
require 'puppet/node/environment'
- Puppet::Node::Environment.new(env).modulepath.collect do |dir|
- Dir.entries(dir).reject { |f| f =~ /^\./ }.collect { |f| File.join(dir, f) }
- end.flatten.collect { |d| [File.join(d, "plugins"), File.join(d, "lib")] }.flatten.find_all do |d|
- FileTest.directory?(d)
- end
+
+ real_env = Puppet::Node::Environment.new(env)
+
+ # We're using a per-thread cache of said module directories, so that
+ # we don't scan the filesystem each time we try to load something with
+ # this autoload instance. But since we don't want to cache for the eternity
+ # this env_module_directories gets reset after the compilation on the master.
+ # This is also reset after an agent ran.
+ # One of the side effect of this change is that this module directories list will be
+ # shared among all autoload that we have running at a time. But that won't be an issue
+ # as by definition those directories are shared by all autoload.
+ Thread.current[:env_module_directories] ||= {}
+ Thread.current[:env_module_directories][real_env] ||= real_env.modulepath.collect do |dir|
+ Dir.entries(dir).reject { |f| f =~ /^\./ }.collect { |f| File.join(dir, f) }
+ end.flatten.collect { |d| [File.join(d, "plugins"), File.join(d, "lib")] }.flatten.find_all do |d|
+ FileTest.directory?(d)
+ end
end
def search_directories(env=nil)
diff --git a/lib/puppet/util/command_line/puppetdoc b/lib/puppet/util/command_line/puppetdoc
index d9bbbec33..0fa1830d6 100755
--- a/lib/puppet/util/command_line/puppetdoc
+++ b/lib/puppet/util/command_line/puppetdoc
@@ -8,15 +8,15 @@
#
# = Usage
#
-# puppet doc [-a|--all] [-h|--help] [-o|--outputdir <rdoc outputdir>] [-m|--mode <text|pdf|markdown|trac|rdoc>]
+# puppet doc [-a|--all] [-h|--help] [-o|--outputdir <rdoc outputdir>] [-m|--mode <text|pdf|rdoc>]
# [-r|--reference <[type]|configuration|..>] [--charset CHARSET] [manifest-file]
#
# = Description
#
-# If mode is not 'rdoc', then this command generates a restructured-text document describing all installed
+# If mode is not 'rdoc', then this command generates a Markdown document describing all installed
# Puppet types or all allowable arguments to puppet executables. It is largely
# meant for internal use and is used to generate the reference document
-# available on the Reductive Labs web site.
+# available on the Puppet Labs web site.
#
# In 'rdoc' mode, this command generates an html RDoc hierarchy describing the manifests that
# are in 'manifestdir' and 'modulepath' configuration directives.
@@ -37,7 +37,7 @@
# Specifies the directory where to output the rdoc documentation in 'rdoc' mode.
#
# mode::
-# Determine the output mode. Valid modes are 'text', 'trac', 'pdf', 'markdown' and 'rdoc'. The 'pdf' and 'markdown' modes create PDF or Markdown formatted files in the /tmp directory. Note that 'trac' mode only works on Reductive Labs servers. The default mode is 'text'. In 'rdoc' mode you must provide 'manifests-path'
+# Determine the output mode. Valid modes are 'text', 'trac', 'pdf' and 'rdoc'. The 'pdf' mode creates PDF formatted files in the /tmp directory. The default mode is 'text'. In 'rdoc' mode you must provide 'manifests-path'
#
# reference::
# Build a particular reference. Get a list of references by running +puppet doc --list+.
@@ -53,7 +53,7 @@
# or
# $ puppet doc /etc/puppet/manifests/site.pp
# or
-# $ puppet doc -m markdown -r configuration
+# $ puppet doc -m pdf -r configuration
#
# = Author
#
diff --git a/lib/puppet/util/command_line/puppetrun b/lib/puppet/util/command_line/puppetrun
index ee95c47eb..27cd775b9 100755
--- a/lib/puppet/util/command_line/puppetrun
+++ b/lib/puppet/util/command_line/puppetrun
@@ -54,8 +54,6 @@
# This is what you would install on your Puppet master; non-master hosts could
# leave off the 'fileserver' and 'puppetmaster' namespaces.
#
-# Expect more documentation on this eventually.
-#
# = Options
#
# Note that any configuration parameter that's valid in the configuration file
diff --git a/lib/puppet/util/command_line/ralsh b/lib/puppet/util/command_line/ralsh
index 68ad92d84..83338fcbc 100755
--- a/lib/puppet/util/command_line/ralsh
+++ b/lib/puppet/util/command_line/ralsh
@@ -59,23 +59,23 @@
# types:
# List all available types.
#
-# verbose::
+# verbose:
# Print extra information.
#
# = Example
#
-# This example uses ``puppet resource`` to return Puppet configuration for the user ``luke``::
-#
-# $ puppet resource user luke
-# user { 'luke':
-# home => '/home/luke',
-# uid => '100',
-# ensure => 'present',
-# comment => 'Luke Kanies,,,',
-# gid => '1000',
-# shell => '/bin/bash',
-# groups => ['sysadmin','audio','video','puppet']
-# }
+# This example uses `puppet resource` to return Puppet configuration for the user `luke`:
+#
+# $ puppet resource user luke
+# user { 'luke':
+# home => '/home/luke',
+# uid => '100',
+# ensure => 'present',
+# comment => 'Luke Kanies,,,',
+# gid => '1000',
+# shell => '/bin/bash',
+# groups => ['sysadmin','audio','video','puppet']
+# }
#
# = Author
#
diff --git a/lib/puppet/util/docs.rb b/lib/puppet/util/docs.rb
index efd054d85..4344d67ab 100644
--- a/lib/puppet/util/docs.rb
+++ b/lib/puppet/util/docs.rb
@@ -47,25 +47,19 @@ module Puppet::Util::Docs
lengths[i] = value.to_s.length if value.to_s.length > lengths[i]
end
- # Add the top header row
- str += lengths.collect { |num| "=" * num }.join(" ") + "\n"
+ # Add the header names
+ str += headers.zip(lengths).collect { |value, num| pad(value, num) }.join(" | ") + " |" + "\n"
- # And the header names
- str += headers.zip(lengths).collect { |value, num| pad(value, num) }.join(" ") + "\n"
-
- # And the second header row
- str += lengths.collect { |num| "=" * num }.join(" ") + "\n"
+ # And the header row
+ str += lengths.collect { |num| "-" * num }.join(" | ") + " |" + "\n"
# Now each data row
data.sort { |a, b| a[0].to_s <=> b[0].to_s }.each do |name, rows|
str += [name, rows].flatten.zip(lengths).collect do |value, length|
pad(value, length)
- end.join(" ") + "\n"
+ end.join(" | ") + " |" + "\n"
end
- # And the bottom line row
- str += lengths.collect { |num| "=" * num }.join(" ") + "\n"
-
str + "\n"
end
@@ -111,4 +105,3 @@ module Puppet::Util::Docs
module_function :scrub
end
-
diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb
index 9664ff310..6b5af8350 100644
--- a/lib/puppet/util/monkey_patches.rb
+++ b/lib/puppet/util/monkey_patches.rb
@@ -25,7 +25,7 @@ end
[Object, Exception, Integer, Struct, Date, Time, Range, Regexp, Hash, Array, Float, String, FalseClass, TrueClass, Symbol, NilClass, Class].each { |cls|
cls.class_eval do
- def to_yaml
+ def to_yaml(ignored=nil)
ZAML.dump(self)
end
end
diff --git a/lib/puppet/util/nagios_maker.rb b/lib/puppet/util/nagios_maker.rb
index 59ed820f9..863fe24fa 100644
--- a/lib/puppet/util/nagios_maker.rb
+++ b/lib/puppet/util/nagios_maker.rb
@@ -45,17 +45,16 @@ module Puppet::Util::NagiosMaker
provider.nagios_type
type.desc "The Nagios type #{name.to_s}. This resource type is autogenerated using the
- model developed in Naginator_, and all of the Nagios types are generated using the
+ model developed in Naginator, and all of the Nagios types are generated using the
same code and the same library.
This type generates Nagios configuration statements in Nagios-parseable configuration
- files. By default, the statements will be added to ``#{target}``, but
- you can send them to a different file by setting their ``target`` attribute.
+ files. By default, the statements will be added to `#{target}`, but
+ you can send them to a different file by setting their `target` attribute.
- You can purge Nagios resources using the ``resources`` type, but *only*
+ You can purge Nagios resources using the `resources` type, but *only*
in the default file locations. This is an architectural limitation.
- .. _naginator: http://projects.reductivelabs.com/projects/naginator
"
end
end
diff --git a/lib/puppet/util/provider_features.rb b/lib/puppet/util/provider_features.rb
index ac294d20d..30e8dcb39 100644
--- a/lib/puppet/util/provider_features.rb
+++ b/lib/puppet/util/provider_features.rb
@@ -72,7 +72,7 @@ module Puppet::Util::ProviderFeatures
names = @features.keys.sort { |a,b| a.to_s <=> b.to_s }
names.each do |name|
doc = @features[name].docs.gsub(/\n\s+/, " ")
- str += "- **#{name}**: #{doc}\n"
+ str += "- *#{name}*: #{doc}\n"
end
if providers.length > 0
@@ -83,7 +83,7 @@ module Puppet::Util::ProviderFeatures
prov = provider(provname)
names.each do |name|
if prov.feature?(name)
- data[provname] << "**X**"
+ data[provname] << "*X*"
else
data[provname] << ""
end
diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb
index 62bab643e..4f2058e69 100644
--- a/lib/puppet/util/reference.rb
+++ b/lib/puppet/util/reference.rb
@@ -15,7 +15,7 @@ class Puppet::Util::Reference
end
def self.modes
- %w{pdf trac text markdown}
+ %w{pdf text}
end
def self.newreference(name, options = {}, &block)
@@ -32,7 +32,7 @@ class Puppet::Util::Reference
section = reference(name) or raise "Could not find section #{name}"
depth = section.depth if section.depth < depth
end
- text = ".. contents:: :depth: 2\n\n"
+ text = "{:toc}\n\n"
end
def self.pdf(text)
@@ -67,32 +67,6 @@ class Puppet::Util::Reference
end
- def self.markdown(name, text)
- puts "Creating markdown for #{name} reference."
- dir = "/tmp/#{Puppet::PUPPETVERSION}"
- FileUtils.mkdir(dir) unless File.directory?(dir)
- Puppet::Util.secure_open(dir + "/#{name}.rst", "w") do |f|
- f.puts text
- end
- pandoc = %x{which pandoc}
- if $CHILD_STATUS != 0 or pandoc =~ /no /
- pandoc = %x{which pandoc}
- end
- if $CHILD_STATUS != 0 or pandoc =~ /no /
- raise "Could not find pandoc"
- end
- pandoc.chomp!
- cmd = %{#{pandoc} -s -r rst -w markdown #{dir}/#{name}.rst -o #{dir}/#{name}.mdwn}
- output = %x{#{cmd}}
- unless $CHILD_STATUS == 0
- $stderr.puts "Pandoc failed to create #{name} reference."
- $stderr.puts output
- exit(1)
- end
-
- File.unlink(dir + "/#{name}.rst")
- end
-
def self.references
instance_loader(:reference).loadall
loaded_instances(:reference).sort { |a,b| a.to_s <=> b.to_s }
@@ -167,7 +141,7 @@ class Puppet::Util::Reference
# First the header
text = h(@title, 1)
text += "\n\n**This page is autogenerated; any changes will get overwritten** *(last generated on #{Time.now.to_s})*\n\n"
- text += ".. contents:: :depth: #{@depth}\n\n" if withcontents
+ text += "{:toc}\n\n" if withcontents
text += @header
@@ -181,27 +155,4 @@ class Puppet::Util::Reference
def to_text(withcontents = true)
strip_trac(to_rest(withcontents))
end
-
- def to_trac(with_contents = true)
- "{{{\n#!rst\n#{self.to_rest(with_contents)}\n}}}"
- end
-
- def trac
- Puppet::Util.secure_open("/tmp/puppetdoc.txt", "w") do |f|
- f.puts self.to_trac
- end
-
- puts "Writing #{@name} reference to trac as #{@page}"
- cmd = %{sudo trac-admin /opt/rl/trac/puppet wiki import %s /tmp/puppetdoc.txt} % self.page
- output = %x{#{cmd}}
- unless $CHILD_STATUS == 0
- $stderr.puts "trac-admin failed"
- $stderr.puts output
- exit(1)
- end
- unless output =~ /^\s+/
- $stderr.puts output
- end
- end
end
-
diff --git a/spec/integration/indirector/bucket_file/rest_spec.rb b/spec/integration/indirector/bucket_file/rest_spec.rb
index 4d90a8c59..dc10faa67 100644
--- a/spec/integration/indirector/bucket_file/rest_spec.rb
+++ b/spec/integration/indirector/bucket_file/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Filebucket REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/certificate/rest_spec.rb b/spec/integration/indirector/certificate/rest_spec.rb
index 356a7d316..58aa96c48 100755
--- a/spec/integration/indirector/certificate/rest_spec.rb
+++ b/spec/integration/indirector/certificate/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Certificate REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/certificate_request/rest_spec.rb b/spec/integration/indirector/certificate_request/rest_spec.rb
index 2c98ef66c..c718b78ab 100755
--- a/spec/integration/indirector/certificate_request/rest_spec.rb
+++ b/spec/integration/indirector/certificate_request/rest_spec.rb
@@ -19,6 +19,7 @@ describe "Certificate Request REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/certificate_revocation_list/rest_spec.rb b/spec/integration/indirector/certificate_revocation_list/rest_spec.rb
index 62a2f808e..86f2b0150 100755
--- a/spec/integration/indirector/certificate_revocation_list/rest_spec.rb
+++ b/spec/integration/indirector/certificate_revocation_list/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Certificate REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/report/rest_spec.rb b/spec/integration/indirector/report/rest_spec.rb
index 089f8fd3f..fdc218975 100644
--- a/spec/integration/indirector/report/rest_spec.rb
+++ b/spec/integration/indirector/report/rest_spec.rb
@@ -17,6 +17,7 @@ describe "Report REST Terminus" do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/indirector/rest_spec.rb b/spec/integration/indirector/rest_spec.rb
index e9048392a..14e9e9593 100755
--- a/spec/integration/indirector/rest_spec.rb
+++ b/spec/integration/indirector/rest_spec.rb
@@ -39,6 +39,7 @@ describe Puppet::Indirector::REST do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet.settings[:server] = "127.0.0.1"
Puppet.settings[:masterport] = "34343"
diff --git a/spec/integration/network/server/webrick_spec.rb b/spec/integration/network/server/webrick_spec.rb
index 2809df780..2b14dfb37 100755
--- a/spec/integration/network/server/webrick_spec.rb
+++ b/spec/integration/network/server/webrick_spec.rb
@@ -18,6 +18,7 @@ describe Puppet::Network::Server do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
diff --git a/spec/integration/parser/compiler_spec.rb b/spec/integration/parser/compiler_spec.rb
index 83bbf9500..9158ad1c2 100755
--- a/spec/integration/parser/compiler_spec.rb
+++ b/spec/integration/parser/compiler_spec.rb
@@ -26,4 +26,47 @@ describe Puppet::Parser::Compiler do
@compiler.catalog.version.should == version
end
+
+ describe "when resolving class references" do
+ it "should favor local scope, even if there's an included class in topscope" do
+ Puppet[:code] = <<-PP
+ class experiment {
+ class baz {
+ }
+ notify {"x" : require => Class[Baz] }
+ }
+ class baz {
+ }
+ include baz
+ include experiment
+ include experiment::baz
+ PP
+
+ catalog = Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode"))
+
+ notify_resource = catalog.resource( "Notify[x]" )
+
+ notify_resource[:require].title.should == "Experiment::Baz"
+ end
+
+ it "should favor local scope, even if there's an unincluded class in topscope" do
+ Puppet[:code] = <<-PP
+ class experiment {
+ class baz {
+ }
+ notify {"x" : require => Class[Baz] }
+ }
+ class baz {
+ }
+ include experiment
+ include experiment::baz
+ PP
+
+ catalog = Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode"))
+
+ notify_resource = catalog.resource( "Notify[x]" )
+
+ notify_resource[:require].title.should == "Experiment::Baz"
+ end
+ end
end
diff --git a/spec/integration/ssl/certificate_authority_spec.rb b/spec/integration/ssl/certificate_authority_spec.rb
index be82b5fb7..fca17b405 100755
--- a/spec/integration/ssl/certificate_authority_spec.rb
+++ b/spec/integration/ssl/certificate_authority_spec.rb
@@ -17,6 +17,7 @@ describe Puppet::SSL::CertificateAuthority do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
@ca = Puppet::SSL::CertificateAuthority.new
diff --git a/spec/integration/ssl/certificate_request_spec.rb b/spec/integration/ssl/certificate_request_spec.rb
index 365ecce38..8426b9dc5 100755
--- a/spec/integration/ssl/certificate_request_spec.rb
+++ b/spec/integration/ssl/certificate_request_spec.rb
@@ -21,6 +21,7 @@ describe Puppet::SSL::CertificateRequest do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :none
diff --git a/spec/integration/ssl/certificate_revocation_list_spec.rb b/spec/integration/ssl/certificate_revocation_list_spec.rb
index 127654ce3..44eee363d 100755
--- a/spec/integration/ssl/certificate_revocation_list_spec.rb
+++ b/spec/integration/ssl/certificate_revocation_list_spec.rb
@@ -17,6 +17,7 @@ describe Puppet::SSL::CertificateRevocationList do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
end
diff --git a/spec/integration/ssl/host_spec.rb b/spec/integration/ssl/host_spec.rb
index 9b4152e83..05862dfc4 100755
--- a/spec/integration/ssl/host_spec.rb
+++ b/spec/integration/ssl/host_spec.rb
@@ -17,6 +17,7 @@ describe Puppet::SSL::Host do
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
+ Puppet.settings[:group] = Process.gid
Puppet::SSL::Host.ca_location = :local
diff --git a/spec/unit/indirector/node/ldap_spec.rb b/spec/unit/indirector/node/ldap_spec.rb
index f9c5efa07..042e7bd54 100755
--- a/spec/unit/indirector/node/ldap_spec.rb
+++ b/spec/unit/indirector/node/ldap_spec.rb
@@ -5,10 +5,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppet/indirector/node/ldap'
describe Puppet::Node::Ldap do
- before do
- Puppet::Node::Facts.stubs(:terminus_class).returns :yaml
- end
-
describe "when searching for a single node" do
before :each do
@searcher = Puppet::Node::Ldap.new
@@ -23,17 +19,17 @@ describe Puppet::Node::Ldap do
end
it "should convert the hostname into a search filter" do
- entry = stub 'entry', :dn => 'cn=mynode.domain.com,ou=hosts,dc=madstop,dc=com', :vals => %w{}, :to_hash => {"environment" => 'production'}
+ entry = stub 'entry', :dn => 'cn=mynode.domain.com,ou=hosts,dc=madstop,dc=com', :vals => %w{}, :to_hash => {}
@searcher.expects(:ldapsearch).with("(&(objectclass=puppetClient)(cn=#{@name}))").yields entry
- @searcher.name2hash(@name, 'production', 'parent')
+ @searcher.name2hash(@name)
end
it "should convert any found entry into a hash" do
- entry = stub 'entry', :dn => 'cn=mynode.domain.com,ou=hosts,dc=madstop,dc=com', :vals => %w{}, :to_hash => {"environment" => 'production'}
+ entry = stub 'entry', :dn => 'cn=mynode.domain.com,ou=hosts,dc=madstop,dc=com', :vals => %w{}, :to_hash => {}
@searcher.expects(:ldapsearch).with("(&(objectclass=puppetClient)(cn=#{@name}))").yields entry
- myhash = {"myhash" => true, :environment => 'production'}
+ myhash = {"myhash" => true}
@searcher.expects(:entry2hash).with(entry).returns myhash
- @searcher.name2hash(@name, 'production', 'parent').should == myhash
+ @searcher.name2hash(@name).should == myhash
end
# This heavily tests our entry2hash method, so we don't have to stub out the stupid entry information any more.
@@ -128,20 +124,20 @@ describe Puppet::Node::Ldap do
end
it "should search first for the provided key" do
- @searcher.expects(:name2hash).with("mynode.domain.com", 'production', 'child').returns({})
+ @searcher.expects(:name2hash).with("mynode.domain.com").returns({})
@searcher.find(@request)
end
it "should search for the short version of the provided key if the key looks like a hostname and no results are found for the key itself" do
- @searcher.expects(:name2hash).with("mynode.domain.com", 'production', 'child').returns(nil)
- @searcher.expects(:name2hash).with("mynode", 'production', 'child').returns({})
+ @searcher.expects(:name2hash).with("mynode.domain.com").returns(nil)
+ @searcher.expects(:name2hash).with("mynode").returns({})
@searcher.find(@request)
end
it "should search for default information if no information can be found for the key" do
- @searcher.expects(:name2hash).with("mynode.domain.com", 'production', 'child').returns(nil)
- @searcher.expects(:name2hash).with("mynode", 'production', 'child').returns(nil)
- @searcher.expects(:name2hash).with("default", 'production', 'child').returns({})
+ @searcher.expects(:name2hash).with("mynode.domain.com").returns(nil)
+ @searcher.expects(:name2hash).with("mynode").returns(nil)
+ @searcher.expects(:name2hash).with("default").returns({})
@searcher.find(@request)
end
@@ -162,8 +158,8 @@ describe Puppet::Node::Ldap do
end
it "should create the node with the correct name, even if it was found by a different name" do
- @searcher.expects(:name2hash).with("mynode.domain.com", 'production', 'child').returns nil
- @searcher.expects(:name2hash).with("mynode", 'production', 'child').returns @result
+ @searcher.expects(:name2hash).with("mynode.domain.com").returns nil
+ @searcher.expects(:name2hash).with("mynode").returns @result
Puppet::Node.expects(:new).with("mynode.domain.com").returns @node
@searcher.find(@request)
@@ -213,15 +209,17 @@ describe Puppet::Node::Ldap do
@parent = {:classes => [], :parameters => {}}
@parent_parent = {:classes => [], :parameters => {}}
- @searcher.stubs(:name2hash).with{|name, env, mode| name == @name}.returns(@entry)
- @searcher.stubs(:name2hash).with{|name, env, mode| name == 'parent'}.returns(@parent)
- @searcher.stubs(:name2hash).with{|name, env, mode| name == 'parent_parent'}.returns(@parent_parent)
+ @searcher.stubs(:name2hash).with(@name).returns(@entry)
+ @searcher.stubs(:name2hash).with('parent').returns(@parent)
+ @searcher.stubs(:name2hash).with('parent_parent').returns(@parent_parent)
@searcher.stubs(:parent_attribute).returns(:parent)
end
it "should search for the parent node" do
@entry[:parent] = "parent"
+ @searcher.expects(:name2hash).with(@name).returns @entry
+ @searcher.expects(:name2hash).with('parent').returns @parent
@searcher.find(@request)
end
@@ -229,7 +227,7 @@ describe Puppet::Node::Ldap do
it "should fail if the parent cannot be found" do
@entry[:parent] = "parent"
- @searcher.expects(:name2hash).with('parent', 'production', 'parent').returns nil
+ @searcher.expects(:name2hash).with('parent').returns nil
proc { @searcher.find(@request) }.should raise_error(Puppet::Error)
end
diff --git a/spec/unit/network/http/rack/rest_spec.rb b/spec/unit/network/http/rack/rest_spec.rb
index 9b3e1e59f..96cf84c37 100755
--- a/spec/unit/network/http/rack/rest_spec.rb
+++ b/spec/unit/network/http/rack/rest_spec.rb
@@ -82,8 +82,8 @@ describe "Puppet::Network::HTTP::RackREST" do
@file.stubs(:is_a?).with(File).returns(true)
end
- it "should set the Content-Length header" do
- @response.expects(:[]=).with("Content-Length", 100)
+ it "should set the Content-Length header as a string" do
+ @response.expects(:[]=).with("Content-Length", '100')
@handler.set_response(@response, @file, 200)
end
@@ -246,4 +246,4 @@ describe Puppet::Network::HTTP::RackREST::RackFile do
@file.expects(:close)
@rackfile.close
end
-end \ No newline at end of file
+end
diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb
index a2f4ab9f0..394db7913 100755
--- a/spec/unit/node/facts_spec.rb
+++ b/spec/unit/node/facts_spec.rb
@@ -88,9 +88,20 @@ describe Puppet::Node::Facts, "when indirecting" do
@facts.save
end
- it "should default to the 'facter' terminus" do
- Puppet::Node::Facts.indirection.terminus_class.should == :facter
+ describe "when the Puppet application is 'master'" do
+ it "should default to the 'yaml' terminus" do
+ pending "Cannot test the behavior of defaults in defaults.rb"
+ # Puppet::Node::Facts.indirection.terminus_class.should == :yaml
+ end
end
+
+ describe "when the Puppet application is not 'master'" do
+ it "should default to the 'facter' terminus" do
+ pending "Cannot test the behavior of defaults in defaults.rb"
+ # Puppet::Node::Facts.indirection.terminus_class.should == :facter
+ end
+ end
+
end
describe "when storing and retrieving" do
diff --git a/spec/unit/parameter/value_collection_spec.rb b/spec/unit/parameter/value_collection_spec.rb
index 78c2c5263..cb82d1517 100755
--- a/spec/unit/parameter/value_collection_spec.rb
+++ b/spec/unit/parameter/value_collection_spec.rb
@@ -68,12 +68,12 @@ describe Puppet::Parameter::ValueCollection do
it "should correctly generate documentation for values" do
@collection.newvalues :foo
- @collection.doc.should be_include("Valid values are ``foo``")
+ @collection.doc.should be_include("Valid values are `foo`")
end
it "should correctly generate documentation for regexes" do
@collection.newvalues %r{\w+}
- @collection.doc.should be_include("Values can match ``/\\w+/``")
+ @collection.doc.should be_include("Values can match `/\\w+/`")
end
it "should be able to find the first matching value" do
diff --git a/spec/unit/parser/ast/leaf_spec.rb b/spec/unit/parser/ast/leaf_spec.rb
index 5bdca67fa..eb71f0d37 100755
--- a/spec/unit/parser/ast/leaf_spec.rb
+++ b/spec/unit/parser/ast/leaf_spec.rb
@@ -47,6 +47,10 @@ describe Puppet::Parser::AST::String do
value = stub 'value', :is_a? => true, :to_s => "ab"
Puppet::Parser::AST::String.new( :value => value ).to_s.should == "\"ab\""
end
+ it "should return a dup of its value" do
+ value = ""
+ Puppet::Parser::AST::String.new( :value => value ).evaluate(stub 'scope').should_not be_equal(value)
+ end
end
end
diff --git a/spec/unit/parser/ast/resource_reference_spec.rb b/spec/unit/parser/ast/resource_reference_spec.rb
index 7b48119f4..93419d963 100755
--- a/spec/unit/parser/ast/resource_reference_spec.rb
+++ b/spec/unit/parser/ast/resource_reference_spec.rb
@@ -32,11 +32,6 @@ describe Puppet::Parser::AST::ResourceReference do
]
end
- it "should pass its scope's namespaces to all created resource references" do
- @scope.add_namespace "foo"
- newref("File", "/tmp/yay").evaluate(@scope).namespaces.should == ["foo"]
- end
-
it "should return a correct representation when converting to string" do
type = stub 'type', :is_a? => true, :to_s => "file"
title = stub 'title', :is_a? => true, :to_s => "[/tmp/a, /tmp/b]"
diff --git a/spec/unit/parser/ast/resource_spec.rb b/spec/unit/parser/ast/resource_spec.rb
index 58ffae925..5c94ac0e9 100755
--- a/spec/unit/parser/ast/resource_spec.rb
+++ b/spec/unit/parser/ast/resource_spec.rb
@@ -113,6 +113,13 @@ describe Puppet::Parser::AST::Resource do
resource("file").evaluate(@twoscope)[0].type.should == "File"
end
+ it "should correctly generate resources that can look up defined classes by title" do
+ @scope.known_resource_types.add_hostclass Puppet::Resource::Type.new(:hostclass, "Myresource", {})
+ res = resource("class").evaluate(@twoscope)[0]
+ res.type.should == "Class"
+ res.title.should == "Myresource"
+ end
+
it "should fail for resource types that do not exist" do
lambda { resource("nosuchtype").evaluate(@twoscope) }.should raise_error(Puppet::ParseError)
end
diff --git a/spec/unit/parser/files_spec.rb b/spec/unit/parser/files_spec.rb
index fcfbfa613..3eb0db07e 100644
--- a/spec/unit/parser/files_spec.rb
+++ b/spec/unit/parser/files_spec.rb
@@ -154,7 +154,7 @@ describe Puppet::Parser::Files do
it "should match against provided fully qualified patterns" do
pattern = @basepath + "/fully/qualified/pattern/*"
- Dir.expects(:glob).with(pattern+'{,.pp,.rb}').returns(%w{my file list})
+ Dir.expects(:glob).with(pattern+'{.pp,.rb}').returns(%w{my file list})
Puppet::Parser::Files.find_manifests(pattern)[1].should == %w{my file list}
end
@@ -168,7 +168,7 @@ describe Puppet::Parser::Files do
pattern = @basepath + "/fully/qualified/pattern/*"
file = @basepath + "/my/file"
dir = @basepath + "/my/directory"
- Dir.expects(:glob).with(pattern+'{,.pp,.rb}').returns([file, dir])
+ Dir.expects(:glob).with(pattern+'{.pp,.rb}').returns([file, dir])
FileTest.expects(:directory?).with(file).returns(false)
FileTest.expects(:directory?).with(dir).returns(true)
Puppet::Parser::Files.find_manifests(pattern)[1].should == [file]
@@ -176,7 +176,7 @@ describe Puppet::Parser::Files do
it "should return files once only" do
pattern = @basepath + "/fully/qualified/pattern/*"
- Dir.expects(:glob).with(pattern+'{,.pp,.rb}').returns(%w{one two one})
+ Dir.expects(:glob).with(pattern+'{.pp,.rb}').returns(%w{one two one})
Puppet::Parser::Files.find_manifests(pattern)[1].should == %w{one two}
end
end
diff --git a/spec/unit/parser/functions/extlookup_spec.rb b/spec/unit/parser/functions/extlookup_spec.rb
index bf2880345..a3dcaa742 100755
--- a/spec/unit/parser/functions/extlookup_spec.rb
+++ b/spec/unit/parser/functions/extlookup_spec.rb
@@ -7,8 +7,9 @@ describe "the extlookup function" do
before :each do
@scope = Puppet::Parser::Scope.new
-
+
@scope.stubs(:environment).returns(Puppet::Node::Environment.new('production'))
+ Puppet::Parser::Functions.function("extlookup")
end
it "should exist" do
@@ -62,9 +63,8 @@ describe "the extlookup function" do
end
describe "should look in $extlookup_datadir for data files listed by $extlookup_precedence" do
- before do
+ before do
@scope.stubs(:lookupvar).with('extlookup_datadir').returns("/tmp")
- @scope.stubs(:lookupvar).with('extlookup_precedence').returns(["one","two"])
File.open("/tmp/one.csv","w"){|one| one.puts "key,value1" }
File.open("/tmp/two.csv","w") do |two|
two.puts "key,value2"
@@ -73,13 +73,23 @@ describe "the extlookup function" do
end
it "when the key is in the first file" do
+ @scope.stubs(:lookupvar).with('extlookup_precedence').returns(["one","two"])
result = @scope.function_extlookup([ "key" ])
result.should == "value1"
end
it "when the key is in the second file" do
+ @scope.stubs(:lookupvar).with('extlookup_precedence').returns(["one","two"])
result = @scope.function_extlookup([ "key2" ])
result.should == "value_two"
end
+
+ it "should not modify extlookup_precedence data" do
+ variable = '%{fqdn}'
+ @scope.stubs(:lookupvar).with('extlookup_precedence').returns([variable,"one"])
+ @scope.stubs(:lookupvar).with('fqdn').returns('myfqdn')
+ result = @scope.function_extlookup([ "key" ])
+ variable.should == '%{fqdn}'
+ end
end
end
diff --git a/spec/unit/parser/functions/include_spec.rb b/spec/unit/parser/functions/include_spec.rb
index e5f051906..4f609b055 100644
--- a/spec/unit/parser/functions/include_spec.rb
+++ b/spec/unit/parser/functions/include_spec.rb
@@ -8,10 +8,6 @@ describe "the 'include' function" do
Puppet::Node::Environment.stubs(:current).returns(nil)
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("foo"))
@scope = Puppet::Parser::Scope.new(:compiler => @compiler)
- # MQR TODO: Without the following stub these tests cause hundreds of spurious errors in
- # subsequent tests. With it, there are no spurious failures and all but one
- # of the tests (marked pending, bellow) fail. This needs a better solution.
- Puppet::Parser::Resource.stubs(:new).with('stage', :main, :scope => @scope).returns 'foo'
end
it "should exist" do
@@ -34,22 +30,4 @@ describe "the 'include' function" do
@compiler.expects(:evaluate_classes).with {|klasses,parser,lazy| lazy == false}.returns("foo")
@scope.function_include("foo")
end
-
- it "should allow a parent to include its child" do
- pending "Resolution of MQR TODO item, above"
- @parent_type = Puppet::Resource::Type.new(:hostclass, "parent")
- @parent_resource = Puppet::Parser::Resource.new(:hostclass, "parent", :scope => @scope)
- @subscope = @parent_type.subscope(@scope,@parent_resource)
- @scope.environment.known_resource_types.stubs(:find_hostclass).with{|nses,name| name.downcase == "parent"}.returns(@parent_type)
-
- @type = Puppet::Resource::Type.new(:hostclass, "foo")
- @type.stubs(:parent_scope).returns(@subscope)
- @type.parent = "parent"
- @resource = Puppet::Parser::Resource.new(:hostclass, "foo", :scope => @subscope)
- @resource.stubs(:resource_type).returns(@type)
- @scope.environment.known_resource_types.stubs(:find_hostclass).with{|nses,name| name.downcase == "foo"}.returns(@parent_type)
- Puppet::Resource.stubs(:new).returns(@resource)
- Puppet::Parser::Resource.stubs(:new).returns(@resource)
- lambda { @subscope.function_include("foo") }.should_not raise_error
- end
end
diff --git a/spec/unit/parser/functions/require_spec.rb b/spec/unit/parser/functions/require_spec.rb
index bd42fa579..49c4bbf74 100755
--- a/spec/unit/parser/functions/require_spec.rb
+++ b/spec/unit/parser/functions/require_spec.rb
@@ -6,7 +6,7 @@ describe "the require function" do
before :each do
@catalog = stub 'catalog'
- @compiler = stub 'compiler', :catalog => @catalog
+ @compiler = stub 'compiler', :catalog => @catalog, :environment => nil
@scope = Puppet::Parser::Scope.new
@scope.stubs(:findresource)
diff --git a/spec/unit/parser/functions/tag_spec.rb b/spec/unit/parser/functions/tag_spec.rb
index ff37badbb..dac134134 100755
--- a/spec/unit/parser/functions/tag_spec.rb
+++ b/spec/unit/parser/functions/tag_spec.rb
@@ -6,6 +6,7 @@ describe "the 'tag' function" do
before :each do
@scope = Puppet::Parser::Scope.new
+ @scope.stubs(:environment).returns(nil)
end
it "should exist" do
diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb
index a85d1b257..7e51423f4 100755
--- a/spec/unit/parser/lexer_spec.rb
+++ b/spec/unit/parser/lexer_spec.rb
@@ -412,6 +412,7 @@ describe Puppet::Parser::Lexer,"when lexing strings" do
%q{'single quoted string with an escaped "\\'"'} => [[:STRING,'single quoted string with an escaped "\'"']],
%q{'single quoted string with an escaped "\$"'} => [[:STRING,'single quoted string with an escaped "\$"']],
%q{'single quoted string with an escaped "\."'} => [[:STRING,'single quoted string with an escaped "\."']],
+ %q{'single quoted string with an escaped "\n"'} => [[:STRING,'single quoted string with an escaped "\n"']],
%q{'single quoted string with an escaped "\\\\"'} => [[:STRING,'single quoted string with an escaped "\\\\"']],
%q{"string with an escaped '\\"'"} => [[:STRING,"string with an escaped '\"'"]],
%q{"string with an escaped '\\$'"} => [[:STRING,"string with an escaped '$'"]],
@@ -619,6 +620,12 @@ describe "Puppet::Parser::Lexer in the old tests" do
@lexer.namespace.should == "base::sub"
end
+ it "should not put class instantiation on the namespace" do
+ @lexer.string = "class base { class sub { class { mode"
+ @lexer.fullscan
+ @lexer.namespace.should == "base::sub"
+ end
+
it "should correctly handle fully qualified names" do
@lexer.string = "class base { class sub::more {"
@lexer.fullscan
diff --git a/spec/unit/parser/resource_spec.rb b/spec/unit/parser/resource_spec.rb
index da49940b0..dae22fcaa 100755
--- a/spec/unit/parser/resource_spec.rb
+++ b/spec/unit/parser/resource_spec.rb
@@ -58,23 +58,17 @@ describe Puppet::Parser::Resource do
end
it "should get its environment from its scope" do
- scope = stub 'scope', :source => stub("source")
- scope.expects(:environment).returns "foo"
+ scope = stub 'scope', :source => stub("source"), :namespaces => nil
+ scope.expects(:environment).returns("foo").at_least_once
Puppet::Parser::Resource.new("file", "whatever", :scope => scope).environment.should == "foo"
end
- it "should get its namespaces from its scope" do
- scope = stub 'scope', :source => stub("source")
- scope.expects(:namespaces).returns %w{one two}
- Puppet::Parser::Resource.new("file", "whatever", :scope => scope).namespaces.should == %w{one two}
- end
-
it "should use the resource type collection helper module" do
Puppet::Parser::Resource.ancestors.should be_include(Puppet::Resource::TypeCollectionHelper)
end
it "should use the scope's environment as its environment" do
- @scope.expects(:environment).returns "myenv"
+ @scope.expects(:environment).returns("myenv").at_least_once
Puppet::Parser::Resource.new("file", "whatever", :scope => @scope).environment.should == "myenv"
end
diff --git a/spec/unit/parser/type_loader_spec.rb b/spec/unit/parser/type_loader_spec.rb
index 8f005d551..83006b37b 100644
--- a/spec/unit/parser/type_loader_spec.rb
+++ b/spec/unit/parser/type_loader_spec.rb
@@ -192,7 +192,7 @@ describe Puppet::Parser::TypeLoader do
end
it "should be able to add classes to the current resource type collection" do
- file = tmpfile("simple_file")
+ file = tmpfile("simple_file.pp")
File.open(file, "w") { |f| f.puts "class foo {}" }
@loader.import(file)
diff --git a/spec/unit/rails/resource_spec.rb b/spec/unit/rails/resource_spec.rb
index 08deda65e..73c7f7af4 100755
--- a/spec/unit/rails/resource_spec.rb
+++ b/spec/unit/rails/resource_spec.rb
@@ -107,7 +107,7 @@ describe "Puppet::Rails::Resource" do
describe "#to_resource" do
it "should instantiate a Puppet::Parser::Resource" do
- scope = stub "scope", :source => nil
+ scope = stub "scope", :source => nil, :environment => nil, :namespaces => nil
@resource = Puppet::Rails::Resource.new
@resource.stubs(:attributes).returns({
diff --git a/spec/unit/resource/catalog_spec.rb b/spec/unit/resource/catalog_spec.rb
index 10cff91a3..2b6beb5e9 100755
--- a/spec/unit/resource/catalog_spec.rb
+++ b/spec/unit/resource/catalog_spec.rb
@@ -224,7 +224,7 @@ describe Puppet::Resource::Catalog, "when compiling" do
end
it "should convert parser resources to plain resources" do
- resource = Puppet::Parser::Resource.new(:file, "foo", :scope => stub("scope"), :source => stub("source"))
+ resource = Puppet::Parser::Resource.new(:file, "foo", :scope => stub("scope", :environment => nil, :namespaces => nil), :source => stub("source"))
catalog = Puppet::Resource::Catalog.new("whev")
catalog.add_resource(resource)
new = catalog.to_resource
diff --git a/spec/unit/resource/type_collection_spec.rb b/spec/unit/resource/type_collection_spec.rb
index 45fc05da0..577aea42b 100644
--- a/spec/unit/resource/type_collection_spec.rb
+++ b/spec/unit/resource/type_collection_spec.rb
@@ -258,6 +258,32 @@ describe Puppet::Resource::TypeCollection do
loader.add instance
loader.find("foo::bar", "eh", :hostclass).should be_nil
end
+
+ describe "when topscope has a class that has the same name as a local class" do
+ before do
+ @loader = Puppet::Resource::TypeCollection.new("env")
+ [ "foo::bar", "bar" ].each do |name|
+ @loader.add Puppet::Resource::Type.new(:hostclass, name)
+ end
+ end
+
+ it "should favor the local class, if the name is unqualified" do
+ @loader.find("foo", "bar", :hostclass).name.should == 'foo::bar'
+ end
+
+ it "should only look in the topclass, if the name is qualified" do
+ @loader.find("foo", "::bar", :hostclass).name.should == 'bar'
+ end
+
+ end
+
+ it "should not look in the local scope for classes when the name is qualified" do
+ @loader = Puppet::Resource::TypeCollection.new("env")
+ @loader.add Puppet::Resource::Type.new(:hostclass, "foo::bar")
+
+ @loader.find("foo", "::bar", :hostclass).should == nil
+ end
+
end
it "should use the generic 'find' method with an empty namespace to find nodes" do
@@ -437,4 +463,5 @@ describe Puppet::Resource::TypeCollection do
end
end
+
end
diff --git a/spec/unit/resource/type_spec.rb b/spec/unit/resource/type_spec.rb
index 0ef4a5166..4d3942c5c 100755
--- a/spec/unit/resource/type_spec.rb
+++ b/spec/unit/resource/type_spec.rb
@@ -369,7 +369,8 @@ describe Puppet::Resource::Type do
end
it "should cache a reference to the parent type" do
- @code.expects(:hostclass).once.with("bar").returns @parent
+ @code.stubs(:hostclass).with("foo::bar").returns nil
+ @code.expects(:hostclass).with("bar").once.returns @parent
@child.parent_type(@scope)
@child.parent_type
end
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 204a2b02e..e65e8a13a 100755
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -123,18 +123,6 @@ describe Puppet::Resource do
Puppet::Resource.new("file", "/my/file", :environment => :foo).environment.name.should == :foo
end
- it "should support specifying namespaces" do
- Puppet::Resource.new("file", "/my/file", :namespaces => ["foo"]).namespaces.should == ["foo"]
- end
-
- it "should convert namespaces to an array if not specified as one" do
- Puppet::Resource.new("file", "/my/file", :namespaces => "foo").namespaces.should == ["foo"]
- end
-
- it "should default to a single amespace of an empty string" do
- Puppet::Resource.new("file", "/my/file").namespaces.should == [""]
- end
-
describe "and munging its type and title" do
describe "when modeling a builtin resource" do
it "should be able to find the resource type" do
@@ -164,16 +152,6 @@ describe Puppet::Resource do
it "should set its title to the provided title" do
Puppet::Resource.new("foo::bar", "/my/file").title.should == "/my/file"
end
-
- describe "and the resource is unqualified and models a qualified resource type" do
- it "should set its type to the fully qualified resource type" do
- Puppet::Resource.new("bar", "/my/file", :namespaces => %w{foo}).type.should == "Foo::Bar"
- end
-
- it "should be able to find the resource type" do
- Puppet::Resource.new("bar", "/my/file", :namespaces => %w{foo}).resource_type.should equal(@type)
- end
- end
end
describe "that does not exist" do
@@ -210,20 +188,6 @@ describe Puppet::Resource do
it "should be able to find the resource type" do
Puppet::Resource.new("class", "foo::bar").resource_type.should equal(@type)
end
-
- describe "and the resource is unqualified and models a qualified class" do
- it "should set its title to the fully qualified resource type" do
- Puppet::Resource.new("class", "bar", :namespaces => %w{foo}).title.should == "Foo::Bar"
- end
-
- it "should be able to find the resource type" do
- Puppet::Resource.new("class", "bar", :namespaces => %w{foo}).resource_type.should equal(@type)
- end
-
- it "should set its type to 'Class'" do
- Puppet::Resource.new("class", "bar", :namespaces => %w{foo}).type.should == "Class"
- end
- end
end
describe "that does not exist" do
diff --git a/spec/unit/transaction/resource_harness_spec.rb b/spec/unit/transaction/resource_harness_spec.rb
index 31965c92c..255481ae4 100755
--- a/spec/unit/transaction/resource_harness_spec.rb
+++ b/spec/unit/transaction/resource_harness_spec.rb
@@ -50,7 +50,7 @@ describe Puppet::Transaction::ResourceHarness do
end
it "should cache and log the current value if no cached values are present" do
- @resource.expects(:info)
+ @resource.expects(:debug)
@harness.copy_audited_parameters(@resource, {:mode => "755"}).should == []
@harness.cached(@resource, :mode).should == "755"
diff --git a/spec/unit/type/schedule_spec.rb b/spec/unit/type/schedule_spec.rb
index 6975529b2..420cffd44 100755
--- a/spec/unit/type/schedule_spec.rb
+++ b/spec/unit/type/schedule_spec.rb
@@ -41,7 +41,7 @@ end
describe Puppet::Type.type(:schedule) do
before :each do
- Puppet.settings.stubs(:value).with(:ignoreschedules).returns(false)
+ Puppet[:ignoreschedules] = false
@schedule = Puppet::Type.type(:schedule).new(:name => "testing")
end
diff --git a/tasks/rake/tracdocs.rake b/tasks/rake/tracdocs.rake
deleted file mode 100644
index d26d8fc17..000000000
--- a/tasks/rake/tracdocs.rake
+++ /dev/null
@@ -1,8 +0,0 @@
-task :tracdocs do
- require 'puppet'
- require 'puppet/util/reference'
- Puppet::Util::Reference.references.each do |ref|
- sh "puppetdoc -m trac -r #{ref.to_s}"
- end
-end
-
diff --git a/test/certmgr/support.rb b/test/certmgr/support.rb
index 3138c94d7..060c458d8 100755
--- a/test/certmgr/support.rb
+++ b/test/certmgr/support.rb
@@ -89,8 +89,9 @@ class TestCertSupport < Test::Unit::TestCase
should_path = Puppet[:hostprivkey]
dir, file = File.split(should_path)
- newfile = file.sub(/^([a-z.]+)\./) { $1.upcase + "."}
+ newfile = file.sub(/^([-a-z.0-9]+)\./) { $1.upcase + "."}
upper_path = File.join(dir, newfile)
+p upper_path
File.open(upper_path, "w") { |f| f.print key.to_s }
user = CertUser.new
diff --git a/test/language/parser.rb b/test/language/parser.rb
index 5a433c724..8cda8eeb2 100755
--- a/test/language/parser.rb
+++ b/test/language/parser.rb
@@ -97,7 +97,7 @@ class TestParser < Test::Unit::TestCase
}
4.times { |i|
- path = File.join(basedir, subdir, "subfile#{i}")
+ path = File.join(basedir, subdir, "subfile#{i}.pp")
mkmanifest(path)
}
@@ -137,8 +137,8 @@ class TestParser < Test::Unit::TestCase
end
def test_importedclasses
- imported = tempfile
- importer = tempfile
+ imported = tempfile '.pp'
+ importer = tempfile '.pp'
made = tempfile
@@ -655,9 +655,9 @@ file { "/tmp/yayness":
end
def test_multiple_imports_on_one_line
- one = tempfile
- two = tempfile
- base = tempfile
+ one = tempfile '.pp'
+ two = tempfile '.pp'
+ base = tempfile '.pp'
File.open(one, "w") { |f| f.puts "$var = value" }
File.open(two, "w") { |f| f.puts "$var = value" }
File.open(base, "w") { |f| f.puts "import '#{one}', '#{two}'" }
diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb
index e31a31902..294d0ef8d 100755
--- a/test/lib/puppettest.rb
+++ b/test/lib/puppettest.rb
@@ -227,14 +227,14 @@ module PuppetTest
#Facter.stubs(:to_hash).returns({})
end
- def tempfile
+ def tempfile(suffix = '')
if defined?(@@tmpfilenum)
@@tmpfilenum += 1
else
@@tmpfilenum = 1
end
- f = File.join(self.tmpdir, "tempfile_" + @@tmpfilenum.to_s)
+ f = File.join(self.tmpdir, "tempfile_" + @@tmpfilenum.to_s + suffix)
@@tmpfiles ||= []
@@tmpfiles << f
f