puppet 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (246) hide show
  1. data/CHANGELOG +123 -0
  2. data/conf/redhat/puppet.spec +8 -2
  3. data/conf/solaris/smf/svc-puppetd +1 -1
  4. data/conf/solaris/smf/svc-puppetmasterd +1 -1
  5. data/conf/suse/client.init +4 -4
  6. data/conf/suse/fileserver.conf +12 -0
  7. data/conf/suse/logrotate +10 -0
  8. data/conf/suse/puppet.conf +25 -0
  9. data/conf/suse/puppet.spec +114 -49
  10. data/conf/suse/ruby-env.patch +17 -0
  11. data/conf/suse/server.init +4 -4
  12. data/ext/logcheck/puppet +23 -23
  13. data/ext/puppet-load.rb +357 -0
  14. data/ext/puppetstoredconfigclean.rb +3 -3
  15. data/ext/rack/files/config.ru +3 -5
  16. data/ext/vim/syntax/puppet.vim +6 -5
  17. data/install.rb +12 -11
  18. data/lib/puppet.rb +1 -1
  19. data/lib/puppet/agent.rb +3 -1
  20. data/lib/puppet/application.rb +2 -3
  21. data/lib/puppet/application/agent.rb +4 -0
  22. data/lib/puppet/application/apply.rb +14 -6
  23. data/lib/puppet/application/describe.rb +1 -1
  24. data/lib/puppet/application/doc.rb +2 -36
  25. data/lib/puppet/application/master.rb +0 -3
  26. data/lib/puppet/application/queue.rb +1 -0
  27. data/lib/puppet/configurer.rb +4 -0
  28. data/lib/puppet/daemon.rb +1 -1
  29. data/lib/puppet/defaults.rb +38 -44
  30. data/lib/puppet/file_serving/indirection_hooks.rb +2 -2
  31. data/lib/puppet/indirector/facts/memory.rb +1 -1
  32. data/lib/puppet/indirector/node/exec.rb +1 -1
  33. data/lib/puppet/indirector/node/ldap.rb +9 -53
  34. data/lib/puppet/indirector/node/memory.rb +1 -1
  35. data/lib/puppet/indirector/yaml.rb +6 -9
  36. data/lib/puppet/network/format_handler.rb +6 -0
  37. data/lib/puppet/network/formats.rb +4 -4
  38. data/lib/puppet/network/http/handler.rb +1 -1
  39. data/lib/puppet/network/http/rack.rb +3 -0
  40. data/lib/puppet/network/http/rack/rest.rb +1 -1
  41. data/lib/puppet/network/rest_authconfig.rb +6 -3
  42. data/lib/puppet/node/environment.rb +15 -5
  43. data/lib/puppet/parameter/value_collection.rb +3 -3
  44. data/lib/puppet/parser/ast/function.rb +0 -1
  45. data/lib/puppet/parser/ast/leaf.rb +1 -1
  46. data/lib/puppet/parser/ast/resource.rb +4 -3
  47. data/lib/puppet/parser/ast/resource_reference.rb +9 -2
  48. data/lib/puppet/parser/compiler.rb +12 -14
  49. data/lib/puppet/parser/files.rb +1 -1
  50. data/lib/puppet/parser/functions.rb +2 -2
  51. data/lib/puppet/parser/functions/defined.rb +1 -1
  52. data/lib/puppet/parser/functions/extlookup.rb +157 -0
  53. data/lib/puppet/parser/functions/file.rb +1 -1
  54. data/lib/puppet/parser/functions/inline_template.rb +6 -5
  55. data/lib/puppet/parser/functions/md5.rb +5 -0
  56. data/lib/puppet/parser/functions/realize.rb +1 -1
  57. data/lib/puppet/parser/functions/regsubst.rb +19 -19
  58. data/lib/puppet/parser/functions/require.rb +2 -3
  59. data/lib/puppet/parser/functions/split.rb +1 -1
  60. data/lib/puppet/parser/functions/sprintf.rb +1 -1
  61. data/lib/puppet/parser/functions/template.rb +4 -2
  62. data/lib/puppet/parser/functions/versioncmp.rb +12 -12
  63. data/lib/puppet/parser/lexer.rb +13 -14
  64. data/lib/puppet/parser/resource.rb +2 -7
  65. data/lib/puppet/parser/resource/param.rb +1 -1
  66. data/lib/puppet/parser/scope.rb +35 -0
  67. data/lib/puppet/parser/type_loader.rb +1 -1
  68. data/lib/puppet/property.rb +5 -5
  69. data/lib/puppet/provider.rb +3 -3
  70. data/lib/puppet/provider/group/groupadd.rb +1 -1
  71. data/lib/puppet/provider/group/ldap.rb +3 -3
  72. data/lib/puppet/provider/group/pw.rb +1 -1
  73. data/lib/puppet/provider/package/apple.rb +1 -1
  74. data/lib/puppet/provider/package/apt.rb +5 -1
  75. data/lib/puppet/provider/package/aptitude.rb +1 -1
  76. data/lib/puppet/provider/package/aptrpm.rb +1 -1
  77. data/lib/puppet/provider/package/blastwave.rb +1 -1
  78. data/lib/puppet/provider/package/dpkg.rb +2 -2
  79. data/lib/puppet/provider/package/fink.rb +1 -1
  80. data/lib/puppet/provider/package/gem.rb +1 -1
  81. data/lib/puppet/provider/package/openbsd.rb +1 -1
  82. data/lib/puppet/provider/package/rpm.rb +1 -1
  83. data/lib/puppet/provider/package/rug.rb +1 -1
  84. data/lib/puppet/provider/package/sunfreeware.rb +2 -2
  85. data/lib/puppet/provider/package/up2date.rb +1 -1
  86. data/lib/puppet/provider/package/urpmi.rb +1 -1
  87. data/lib/puppet/provider/package/yum.rb +1 -1
  88. data/lib/puppet/provider/package/zypper.rb +1 -1
  89. data/lib/puppet/provider/service/base.rb +1 -1
  90. data/lib/puppet/provider/service/bsd.rb +2 -2
  91. data/lib/puppet/provider/service/debian.rb +2 -2
  92. data/lib/puppet/provider/service/gentoo.rb +2 -2
  93. data/lib/puppet/provider/service/init.rb +2 -2
  94. data/lib/puppet/provider/service/redhat.rb +2 -2
  95. data/lib/puppet/provider/user/ldap.rb +3 -3
  96. data/lib/puppet/provider/user/pw.rb +1 -1
  97. data/lib/puppet/provider/user/user_role_add.rb +1 -1
  98. data/lib/puppet/provider/user/useradd.rb +1 -1
  99. data/lib/puppet/rails/host.rb +1 -0
  100. data/lib/puppet/reference/configuration.rb +37 -34
  101. data/lib/puppet/reference/indirection.rb +3 -4
  102. data/lib/puppet/reference/metaparameter.rb +0 -8
  103. data/lib/puppet/reference/network.rb +6 -4
  104. data/lib/puppet/reference/providers.rb +4 -4
  105. data/lib/puppet/reference/report.rb +5 -6
  106. data/lib/puppet/reference/type.rb +14 -14
  107. data/lib/puppet/reports/http.rb +1 -1
  108. data/lib/puppet/reports/rrdgraph.rb +8 -9
  109. data/lib/puppet/reports/store.rb +2 -2
  110. data/lib/puppet/reports/tagmail.rb +12 -13
  111. data/lib/puppet/resource.rb +15 -115
  112. data/lib/puppet/resource/catalog.rb +1 -1
  113. data/lib/puppet/resource/type.rb +26 -3
  114. data/lib/puppet/resource/type_collection.rb +3 -6
  115. data/lib/puppet/simple_graph.rb +4 -5
  116. data/lib/puppet/transaction/resource_harness.rb +1 -1
  117. data/lib/puppet/type.rb +100 -92
  118. data/lib/puppet/type/augeas.rb +44 -45
  119. data/lib/puppet/type/computer.rb +2 -2
  120. data/lib/puppet/type/cron.rb +29 -29
  121. data/lib/puppet/type/exec.rb +66 -67
  122. data/lib/puppet/type/file.rb +25 -25
  123. data/lib/puppet/type/file/content.rb +7 -1
  124. data/lib/puppet/type/file/ensure.rb +13 -13
  125. data/lib/puppet/type/file/mode.rb +6 -6
  126. data/lib/puppet/type/file/selcontext.rb +5 -5
  127. data/lib/puppet/type/file/source.rb +36 -26
  128. data/lib/puppet/type/filebucket.rb +5 -6
  129. data/lib/puppet/type/group.rb +1 -2
  130. data/lib/puppet/type/host.rb +3 -6
  131. data/lib/puppet/type/k5login.rb +3 -3
  132. data/lib/puppet/type/macauthorization.rb +1 -2
  133. data/lib/puppet/type/mailalias.rb +0 -1
  134. data/lib/puppet/type/maillist.rb +0 -1
  135. data/lib/puppet/type/mcx.rb +9 -9
  136. data/lib/puppet/type/mount.rb +9 -10
  137. data/lib/puppet/type/notify.rb +0 -1
  138. data/lib/puppet/type/package.rb +34 -36
  139. data/lib/puppet/type/resources.rb +1 -5
  140. data/lib/puppet/type/schedule.rb +9 -12
  141. data/lib/puppet/type/selboolean.rb +2 -7
  142. data/lib/puppet/type/selmodule.rb +3 -4
  143. data/lib/puppet/type/service.rb +9 -9
  144. data/lib/puppet/type/ssh_authorized_key.rb +2 -3
  145. data/lib/puppet/type/sshkey.rb +4 -7
  146. data/lib/puppet/type/stage.rb +5 -4
  147. data/lib/puppet/type/tidy.rb +3 -3
  148. data/lib/puppet/type/user.rb +1 -2
  149. data/lib/puppet/type/whit.rb +7 -0
  150. data/lib/puppet/type/yumrepo.rb +16 -3
  151. data/lib/puppet/type/zfs.rb +1 -2
  152. data/lib/puppet/type/zone.rb +28 -28
  153. data/lib/puppet/type/zpool.rb +10 -5
  154. data/lib/puppet/util/autoload.rb +17 -5
  155. data/lib/puppet/util/cacher.rb +15 -10
  156. data/lib/puppet/util/command_line/puppetdoc +5 -5
  157. data/lib/puppet/util/command_line/puppetrun +0 -2
  158. data/lib/puppet/util/command_line/ralsh +13 -13
  159. data/lib/puppet/util/docs.rb +5 -12
  160. data/lib/puppet/util/monkey_patches.rb +5 -2
  161. data/lib/puppet/util/nagios_maker.rb +4 -5
  162. data/lib/puppet/util/provider_features.rb +2 -2
  163. data/lib/puppet/util/rdoc.rb +1 -1
  164. data/lib/puppet/util/rdoc/parser.rb +5 -3
  165. data/lib/puppet/util/reference.rb +3 -52
  166. data/man/man5/puppet.conf.5 +2072 -1526
  167. data/man/man8/filebucket.8 +104 -106
  168. data/man/man8/pi.8 +14 -47
  169. data/man/man8/puppet.8 +8 -9
  170. data/man/man8/puppetca.8 +168 -129
  171. data/man/man8/puppetd.8 +282 -226
  172. data/man/man8/puppetdoc.8 +103 -103
  173. data/man/man8/puppetmasterd.8 +51 -71
  174. data/man/man8/puppetqd.8 +18 -53
  175. data/man/man8/puppetrun.8 +163 -143
  176. data/man/man8/ralsh.8 +77 -114
  177. data/spec/integration/indirector/bucket_file/rest_spec.rb +1 -0
  178. data/spec/integration/indirector/certificate/rest_spec.rb +1 -0
  179. data/spec/integration/indirector/certificate_request/rest_spec.rb +1 -0
  180. data/spec/integration/indirector/certificate_revocation_list/rest_spec.rb +1 -0
  181. data/spec/integration/indirector/report/rest_spec.rb +1 -0
  182. data/spec/integration/indirector/rest_spec.rb +1 -0
  183. data/spec/integration/network/server/webrick_spec.rb +1 -0
  184. data/spec/integration/parser/compiler_spec.rb +43 -0
  185. data/spec/integration/provider/mailalias/aliases_spec.rb +5 -5
  186. data/spec/integration/ssl/certificate_authority_spec.rb +1 -0
  187. data/spec/integration/ssl/certificate_request_spec.rb +1 -0
  188. data/spec/integration/ssl/certificate_revocation_list_spec.rb +1 -0
  189. data/spec/integration/ssl/host_spec.rb +1 -0
  190. data/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +0 -1
  191. data/spec/monkey_patches/publicize_methods.rb +11 -0
  192. data/spec/shared_behaviours/file_serving.rb +12 -1
  193. data/spec/spec_helper.rb +6 -25
  194. data/spec/unit/application/apply_spec.rb +22 -4
  195. data/spec/unit/application/cert_spec.rb +1 -1
  196. data/spec/unit/application/doc_spec.rb +0 -19
  197. data/spec/unit/application/master_spec.rb +1 -1
  198. data/spec/unit/application_spec.rb +2 -12
  199. data/spec/unit/indirector/node/ldap_spec.rb +19 -21
  200. data/spec/unit/indirector/yaml_spec.rb +18 -6
  201. data/spec/unit/network/http/rack/rest_spec.rb +3 -3
  202. data/spec/unit/network/http/webrick/rest_spec.rb +1 -0
  203. data/spec/unit/node/environment_spec.rb +32 -3
  204. data/spec/unit/node/facts_spec.rb +13 -2
  205. data/spec/unit/parameter/value_collection_spec.rb +2 -2
  206. data/spec/unit/parser/ast/leaf_spec.rb +4 -0
  207. data/spec/unit/parser/ast/resource_reference_spec.rb +0 -5
  208. data/spec/unit/parser/ast/resource_spec.rb +7 -0
  209. data/spec/unit/parser/compiler_spec.rb +12 -1
  210. data/spec/unit/parser/files_spec.rb +3 -3
  211. data/spec/unit/parser/functions/extlookup_spec.rb +95 -0
  212. data/spec/unit/parser/functions/include_spec.rb +33 -0
  213. data/spec/unit/parser/functions/require_spec.rb +1 -1
  214. data/spec/unit/parser/functions/tag_spec.rb +1 -0
  215. data/spec/unit/parser/lexer_spec.rb +10 -1
  216. data/spec/unit/parser/resource_spec.rb +3 -9
  217. data/spec/unit/parser/type_loader_spec.rb +1 -1
  218. data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +4 -2
  219. data/spec/unit/rails/resource_spec.rb +1 -1
  220. data/spec/unit/reports/tagmail_spec.rb +2 -2
  221. data/spec/unit/resource/catalog_spec.rb +1 -1
  222. data/spec/unit/resource/type_collection_spec.rb +35 -0
  223. data/spec/unit/resource/type_spec.rb +19 -1
  224. data/spec/unit/resource_spec.rb +0 -36
  225. data/spec/unit/simple_graph_spec.rb +12 -2
  226. data/spec/unit/transaction/resource_harness_spec.rb +1 -1
  227. data/spec/unit/type/file/content_spec.rb +2 -1
  228. data/spec/unit/type/schedule_spec.rb +1 -1
  229. data/spec/unit/type/service_spec.rb +8 -0
  230. data/spec/unit/type/user_spec.rb +5 -0
  231. data/spec/unit/util/backups_spec.rb +0 -1
  232. data/spec/unit/util/rdoc/parser_spec.rb +3 -3
  233. data/spec/unit/util/rdoc_spec.rb +13 -0
  234. data/test/certmgr/support.rb +2 -1
  235. data/test/language/parser.rb +6 -6
  236. data/test/lib/puppettest.rb +3 -23
  237. data/test/lib/puppettest/fakes.rb +1 -1
  238. data/test/lib/puppettest/support/assertions.rb +0 -2
  239. data/test/lib/puppettest/support/utils.rb +25 -20
  240. data/test/ral/manager/attributes.rb +4 -1
  241. metadata +15 -9
  242. data/conf/suse/puppet.suse.patch +0 -16
  243. data/ext/extlookup.rb +0 -181
  244. data/ext/puppetlast +0 -16
  245. data/tasks/rake/tracdocs.rake +0 -8
  246. data/test/lib/mocha_standalone.rb +0 -2
@@ -4,15 +4,13 @@
4
4
  # if puppet is not in your RUBYLIB:
5
5
  # $:.unshift('/opt/puppet/lib')
6
6
 
7
- $0 = "puppetmasterd"
8
- require 'puppet'
7
+ $0 = "master"
9
8
 
10
9
  # if you want debugging:
11
10
  # ARGV << "--debug"
12
11
 
13
12
  ARGV << "--rack"
14
- require 'puppet/application/puppetmasterd'
13
+ require 'puppet/application/master'
15
14
  # we're usually running inside a Rack::Builder.new {} block,
16
15
  # therefore we need to call run *here*.
17
- run Puppet::Application[:puppetmasterd].run
18
-
16
+ run Puppet::Application[:master].run
@@ -19,7 +19,7 @@ endif
19
19
  " match class/definition/node declarations
20
20
  syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe
21
21
  syn keyword puppetDefType class define node inherits contained
22
- syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument
22
+ syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString
23
23
  syn match puppetArgument "\w\+" contained
24
24
  syn match puppetArgument "\$\w\+" contained
25
25
  syn match puppetArgument "'[^']+'" contained
@@ -33,6 +33,7 @@ syn match puppetNodeRe "/.*/" contained
33
33
  "FIXME: "Foo-bar" doesn't get highlighted as expected, although "foo-bar" does.
34
34
  syn match puppetInstance "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)*\s*{" contains=puppetTypeName,puppetTypeDefault
35
35
  syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*[[{]" contains=puppetTypeName,puppetTypeDefault
36
+ syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*<\?<|" contains=puppetTypeName,puppetTypeDefault
36
37
  syn match puppetTypeName "[a-z]\w*" contained
37
38
  syn match puppetTypeDefault "[A-Z]\w*" contained
38
39
 
@@ -56,19 +57,19 @@ syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fai
56
57
  " rvalues
57
58
  syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
58
59
 
59
- syn match puppetVariable "$\w\+"
60
- syn match puppetVariable "${\w\+}"
60
+ syn match puppetVariable "$[a-zA-Z0-9_:]\+"
61
+ syn match puppetVariable "${[a-zA-Z0-9_:]\+}"
61
62
 
62
63
  " match anything between simple/double quotes.
63
64
  " don't match variables if preceded by a backslash.
64
65
  syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+
65
66
  syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
66
- syn match puppetString "/.*/"
67
+ syn match puppetString "/[^/]*/"
67
68
  syn match puppetNotVariable "\\$\w\+" contained
68
69
  syn match puppetNotVariable "\\${\w\+}" contained
69
70
 
70
71
  syn keyword puppetKeyword import inherits include
71
- syn keyword puppetControl case default if else
72
+ syn keyword puppetControl case default if else elsif
72
73
  syn keyword puppetSpecial true false undef
73
74
 
74
75
  " comments last overriding everything else
data/install.rb CHANGED
@@ -55,13 +55,13 @@ end
55
55
 
56
56
  begin
57
57
  if $haverdoc
58
- rst2man = %x{which rst2man.py}
58
+ ronn = %x{which ronn}
59
59
  $haveman = true
60
60
  else
61
61
  $haveman = false
62
62
  end
63
63
  rescue
64
- puts "Missing rst2man; skipping man page creation"
64
+ puts "Missing ronn; skipping man page creation"
65
65
  $haveman = false
66
66
  end
67
67
 
@@ -347,21 +347,22 @@ end
347
347
  def build_man(bins, sbins)
348
348
  return unless $haveman
349
349
  begin
350
- # Locate rst2man
351
- rst2man = %x{which rst2man.py}
352
- rst2man.chomp!
350
+ # Locate ronn
351
+ ronn = %x{which ronn}
352
+ ronn.chomp!
353
353
  # Create puppet.conf.5 man page
354
- %x{bin/puppetdoc --reference configuration > ./puppet.conf.rst}
355
- %x{#{rst2man} ./puppet.conf.rst ./man/man5/puppet.conf.5}
356
- File.unlink("./puppet.conf.rst")
354
+ %x{bin/puppetdoc --reference configuration > ./man/man5/puppetconf.5.ronn}
355
+ %x{#{ronn} -r ./man/man5/puppetconf.5.ronn}
356
+ File.move("./man/man5/puppetconf.5", "./man/man5/puppet.conf.5")
357
+ File.unlink("./man/man5/puppetconf.5.ronn")
357
358
 
358
359
  # Create binary man pages
359
360
  binary = bins + sbins
360
361
  binary.each do |bin|
361
362
  b = bin.gsub( /(bin|sbin)\//, "")
362
- %x{#{bin} --help > ./#{b}.rst}
363
- %x{#{rst2man} ./#{b}.rst ./man/man8/#{b}.8}
364
- File.unlink("./#{b}.rst")
363
+ %x{#{bin} --help > ./man/man8/#{b}.8.ronn}
364
+ %x{#{ronn} -r ./man/man8/#{b}.8.ronn}
365
+ File.unlink("./man/man8/#{b}.8.ronn")
365
366
  end
366
367
 
367
368
  rescue SystemCallError
@@ -24,7 +24,7 @@ require 'puppet/util/run_mode'
24
24
  # it's also a place to find top-level commands like 'debug'
25
25
 
26
26
  module Puppet
27
- PUPPETVERSION = '2.6.0'
27
+ PUPPETVERSION = '2.6.1'
28
28
 
29
29
  def Puppet.version
30
30
  PUPPETVERSION
@@ -37,7 +37,9 @@ class Puppet::Agent
37
37
  with_client do |client|
38
38
  begin
39
39
  sync.synchronize { lock { result = client.run(*args) } }
40
- rescue => detail
40
+ rescue SystemExit,NoMemoryError
41
+ raise
42
+ rescue Exception => detail
41
43
  puts detail.backtrace if Puppet[:trace]
42
44
  Puppet.err "Could not run #{client_class}: #{detail}"
43
45
  end
@@ -264,7 +264,6 @@ class Application
264
264
  self.send(fname, value)
265
265
  end
266
266
  end
267
- @option_parser.default_argv = self.command_line.args
268
267
  @option_parser
269
268
  end
270
269
 
@@ -286,7 +285,7 @@ class Application
286
285
  Puppet.settings.set_value(:name, Puppet.application_name.to_s, :mutable_defaults)
287
286
  Puppet.settings.set_value(:logdir, Puppet.run_mode.logopts, :mutable_defaults)
288
287
  Puppet.settings.set_value(:rundir, Puppet.run_mode.run_dir, :mutable_defaults)
289
- Puppet.settings.set_value(:mode, Puppet.run_mode.name.to_s, :mutable_defaults)
288
+ Puppet.settings.set_value(:run_mode, Puppet.run_mode.name.to_s, :mutable_defaults)
290
289
  end
291
290
 
292
291
  require 'puppet'
@@ -337,7 +336,7 @@ class Application
337
336
 
338
337
  # scan command line argument
339
338
  begin
340
- self.option_parser.parse!
339
+ self.option_parser.parse!(self.command_line.args)
341
340
  rescue OptionParser::ParseError => detail
342
341
  $stderr.puts detail
343
342
  $stderr.puts "Try 'puppet #{command_line.subcommand_name} --help'"
@@ -219,6 +219,10 @@ class Puppet::Application::Agent < Puppet::Application
219
219
 
220
220
  Puppet.settings.use :main, :agent, :ssl
221
221
 
222
+ # Always ignoreimport for agent. It really shouldn't even try to import,
223
+ # but this is just a temporary band-aid.
224
+ Puppet[:ignoreimport] = true
225
+
222
226
  # We need to specify a ca location for all of the SSL-related i
223
227
  # indirected classes to work; in fingerprint mode we just need
224
228
  # access to the local files and we don't need a ca.
@@ -78,7 +78,10 @@ class Puppet::Application::Apply < Puppet::Application
78
78
  if options[:code] or command_line.args.length == 0
79
79
  Puppet[:code] = options[:code] || STDIN.read
80
80
  else
81
- Puppet[:manifest] = command_line.args.shift
81
+ manifest = command_line.args.shift
82
+ raise "Could not find file #{manifest}" unless File.exist?(manifest)
83
+ Puppet.warning("Only one file can be applied per run. Skipping #{command_line.args.join(', ')}") if command_line.args.size > 0
84
+ Puppet[:manifest] = manifest
82
85
  end
83
86
 
84
87
  # Collect our facts.
@@ -123,17 +126,22 @@ class Puppet::Application::Apply < Puppet::Application
123
126
  configurer.execute_prerun_command
124
127
 
125
128
  # And apply it
129
+ if Puppet[:report]
130
+ report = configurer.initialize_report
131
+ Puppet::Util::Log.newdestination(report)
132
+ end
126
133
  transaction = catalog.apply
127
134
 
128
135
  configurer.execute_postrun_command
129
136
 
130
- status = 0
131
- if not Puppet[:noop] and options[:detailed_exitcodes]
132
- transaction.generate_report
133
- exit(transaction.report.exit_status)
137
+ if Puppet[:report]
138
+ Puppet::Util::Log.close(report)
139
+ configurer.send_report(report, transaction)
134
140
  else
135
- exit(0)
141
+ transaction.generate_report
136
142
  end
143
+
144
+ exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? transaction.report.exit_status : 0 )
137
145
  rescue => detail
138
146
  puts detail.backtrace if Puppet[:trace]
139
147
  $stderr.puts detail.message
@@ -130,7 +130,7 @@ class TypeDoc
130
130
  a[0].to_s <=> b[0].to_s
131
131
  }.each { |name, doc|
132
132
  print "\n- **#{name}**"
133
- if type.namevar == name and name != :name
133
+ if type.key_attributes.include?(name) and name != :name
134
134
  puts " (*namevar*)"
135
135
  else
136
136
  puts ""
@@ -56,7 +56,7 @@ class Puppet::Application::Doc < Puppet::Application
56
56
  end
57
57
 
58
58
  def run_command
59
- return[:rdoc, :trac, :markdown].include?(options[:mode]) ? send(options[:mode]) : other
59
+ return[:rdoc].include?(options[:mode]) ? send(options[:mode]) : other
60
60
  end
61
61
 
62
62
  def rdoc
@@ -72,7 +72,7 @@ class Puppet::Application::Doc < Puppet::Application
72
72
 
73
73
  Puppet.settings.setdefaults(
74
74
  "puppetdoc",
75
-
75
+
76
76
  "document_all" => [false, "Document all resources"]
77
77
  )
78
78
  Puppet.settings[:document_all] = options[:all] || false
@@ -92,40 +92,6 @@ class Puppet::Application::Doc < Puppet::Application
92
92
  exit exit_code
93
93
  end
94
94
 
95
- def trac
96
- require 'puppet/util/reference'
97
- options[:references].each do |name|
98
- section = Puppet::Util::Reference.reference(name) or raise "Could not find section #{name}"
99
- section.trac unless options[:mode] == :pdf
100
- end
101
- end
102
-
103
- def markdown
104
- text = ""
105
- with_contents = false
106
- exit_code = 0
107
- require 'puppet/util/reference'
108
- options[:references].sort { |a,b| a.to_s <=> b.to_s }.each do |name|
109
- raise "Could not find reference #{name}" unless section = Puppet::Util::Reference.reference(name)
110
-
111
- begin
112
- # Add the per-section text, but with no ToC
113
- text += section.send(options[:format], with_contents)
114
- text += Puppet::Util::Reference.footer
115
- text.gsub!(/`\w+\s+([^`]+)`:trac:/) { |m| $1 }
116
- Puppet::Util::Reference.markdown(name, text)
117
- text = ""
118
- rescue => detail
119
- puts detail.backtrace
120
- $stderr.puts "Could not generate reference #{name}: #{detail}"
121
- exit_code = 1
122
- next
123
- end
124
- end
125
-
126
- exit exit_code
127
- end
128
-
129
95
  def other
130
96
  text = ""
131
97
  with_contents = options[:references].length <= 1
@@ -138,9 +138,6 @@ class Puppet::Application::Master < Puppet::Application
138
138
 
139
139
  Puppet.settings.use :main, :master, :ssl
140
140
 
141
- # A temporary solution, to at least make the master work for now.
142
- Puppet::Node::Facts.terminus_class = :yaml
143
-
144
141
  # Cache our nodes in yaml. Currently not configurable.
145
142
  Puppet::Node.cache_class = :yaml
146
143
 
@@ -38,6 +38,7 @@ class Puppet::Application::Queue < Puppet::Application
38
38
  option("--verbose","-v")
39
39
 
40
40
  def main
41
+ require 'puppet/indirector/catalog/queue' # provides Puppet::Indirector::Queue.subscribe
41
42
  Puppet.notice "Starting puppetqd #{Puppet.version}"
42
43
  Puppet::Resource::Catalog::Queue.subscribe do |catalog|
43
44
  # Once you have a Puppet::Resource::Catalog instance, calling save on it should suffice
@@ -158,6 +158,10 @@ class Puppet::Configurer
158
158
  return
159
159
  end
160
160
  ensure
161
+ # Make sure we forget the retained module_directories of any autoload
162
+ # we might have used.
163
+ Thread.current[:env_module_directories] = nil
164
+
161
165
  # Now close all of our existing http connections, since there's no
162
166
  # reason to leave them lying open.
163
167
  Puppet::Network::HttpPool.clear_http_instances
@@ -121,8 +121,8 @@ class Puppet::Daemon
121
121
  create_pidfile
122
122
 
123
123
  raise Puppet::DevError, "Daemons must have an agent, server, or both" unless agent or server
124
- agent.start if agent
125
124
  server.start if server
125
+ agent.start if agent
126
126
 
127
127
  EventLoop.current.run
128
128
  end
@@ -2,12 +2,12 @@
2
2
  module Puppet
3
3
  setdefaults(:main,
4
4
  :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
5
- 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,
6
- it defaults to being in ``~``."],
5
+ 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,
6
+ it defaults to being in `~`."],
7
7
  :vardir => [Puppet.run_mode.var_dir, "Where Puppet stores dynamic and growing data. The default for this parameter is calculated specially, like `confdir`_."],
8
8
  :name => [Puppet.application_name.to_s, "The name of the application, if we are running as one. The
9
- default is essentially $0 without the path or ``.rb``."],
10
- :mode => [Puppet.run_mode.name.to_s, "The effective 'run mode' of the application: master, agent, or user."]
9
+ default is essentially $0 without the path or `.rb`."],
10
+ :run_mode => [Puppet.run_mode.name.to_s, "The effective 'run mode' of the application: master, agent, or user."]
11
11
  )
12
12
 
13
13
  setdefaults(:main, :logdir => Puppet.run_mode.logopts)
@@ -44,8 +44,8 @@ module Puppet
44
44
  specify 'all'. This feature is only available in Puppet versions
45
45
  higher than 0.18.4."],
46
46
  :color => ["ansi", "Whether to use colors when logging to the console.
47
- Valid values are ``ansi`` (equivalent to ``true``), ``html`` (mostly
48
- used during testing with TextMate), and ``false``, which produces
47
+ Valid values are `ansi` (equivalent to `true`), `html` (mostly
48
+ used during testing with TextMate), and `false`, which produces
49
49
  no color."],
50
50
  :mkusers => [false,
51
51
  "Whether to create the necessary user and group that puppet agent will
@@ -92,18 +92,18 @@ module Puppet
92
92
  :authconfig => [ "$confdir/namespaceauth.conf",
93
93
  "The configuration file that defines the rights to the different
94
94
  namespaces and methods. This can be used as a coarse-grained
95
- authorization system for both ``puppet agent`` and ``puppet master``."
95
+ authorization system for both `puppet agent` and `puppet master`."
96
96
  ],
97
97
  :environment => {:default => "production", :desc => "The environment Puppet is running in. For clients
98
- (e.g., ``puppet agent``) this determines the environment itself, which
99
- is used to find modules and much more. For servers (i.e., ``puppet master``) this provides the default environment for nodes
98
+ (e.g., `puppet agent`) this determines the environment itself, which
99
+ is used to find modules and much more. For servers (i.e., `puppet master`) this provides the default environment for nodes
100
100
  we know nothing about."
101
101
  },
102
102
  :diff_args => ["-u", "Which arguments to pass to the diff command when printing differences between files."],
103
103
  :diff => ["diff", "Which diff command to use when printing differences between files."],
104
104
  :show_diff => [false, "Whether to print a contextual diff when files are being replaced. The diff
105
105
  is printed on stdout, so this option is meaningless unless you are running Puppet interactively.
106
- This feature currently requires the ``diff/lcs`` Ruby library."],
106
+ This feature currently requires the `diff/lcs` Ruby library."],
107
107
  :daemonize => { :default => true,
108
108
  :desc => "Send the process into the background. This is the default.",
109
109
  :short => "D"
@@ -115,7 +115,7 @@ module Puppet
115
115
  :node_terminus => ["plain", "Where to find information about nodes."],
116
116
  :catalog_terminus => ["compiler", "Where to get node catalogs. This is useful to change if, for instance,
117
117
  you'd like to pre-compile catalogs and store them in memcached or some other easily-accessed store."],
118
- :facts_terminus => ["facter", "Where to get node facts."],
118
+ :facts_terminus => [Puppet.application_name.to_s == "master" ? 'yaml' : 'facter', "The node facts terminus."],
119
119
  :httplog => { :default => "$logdir/http.log",
120
120
  :owner => "root",
121
121
  :mode => 0640,
@@ -135,7 +135,7 @@ module Puppet
135
135
  :queue_source => ["stomp://localhost:61613/", "Which type of queue to use for asynchronous processing. If your stomp server requires
136
136
  authentication, you can include it in the URI as long as your stomp client library is at least 1.1.1"],
137
137
  :async_storeconfigs => {:default => false, :desc => "Whether to use a queueing system to provide asynchronous database integration.
138
- Requires that ``puppetqd`` be running and that 'PSON' support for ruby be installed.",
138
+ Requires that `puppetqd` be running and that 'PSON' support for ruby be installed.",
139
139
  :hook => proc do |value|
140
140
  if value
141
141
  # This reconfigures the terminii for Node, Facts, and Catalog
@@ -266,7 +266,6 @@ module Puppet
266
266
  to all clients. If enabled, CA chaining will almost definitely not work."]
267
267
  )
268
268
 
269
-
270
269
  setdefaults(
271
270
  :ca,
272
271
  :ca_name => ["$certname", "The name to use the Certificate Authority certificate."],
@@ -385,7 +384,7 @@ module Puppet
385
384
  :manifestdir => ["$confdir/manifests", "Where puppet master looks for its manifests."],
386
385
  :manifest => ["$manifestdir/site.pp", "The entry-point manifest for puppet master."],
387
386
  :code => ["", "Code to parse directly. This is essentially only used
388
- by ``puppet``, and should only be set if you're writing your own Puppet
387
+ by `puppet`, and should only be set if you're writing your own Puppet
389
388
  executable"],
390
389
  :masterlog => { :default => "$logdir/puppetmaster.log",
391
390
  :owner => "service",
@@ -419,7 +418,7 @@ module Puppet
419
418
  :rest_authconfig => [ "$confdir/auth.conf",
420
419
  "The configuration file that defines the rights to the different
421
420
  rest indirections. This can be used as a fine-grained
422
- authorization system for ``puppet master``."
421
+ authorization system for `puppet master`."
423
422
  ],
424
423
  :ca => [true, "Wether the master should function as a certificate authority."],
425
424
  :modulepath => {:default => "$confdir/modules:/usr/share/puppet/modules",
@@ -427,7 +426,7 @@ module Puppet
427
426
  directories.", :type => :setting }, # We don't want this to be considered a file, since it's multiple files.
428
427
  :ssl_client_header => ["HTTP_X_CLIENT_DN", "The header containing an authenticated
429
428
  client's SSL DN. Only used with Mongrel. This header must be set by the proxy
430
- to the authenticated client's SSL DN (e.g., ``/CN=puppet.puppetlabs.com``).
429
+ to the authenticated client's SSL DN (e.g., `/CN=puppet.puppetlabs.com`).
431
430
  See http://projects.puppetlabs.com/projects/puppet/wiki/Using_Mongrel for more information."],
432
431
  :ssl_client_verify_header => ["HTTP_X_CLIENT_VERIFY", "The header containing the status
433
432
  message of the client verification. Only used with Mongrel. This header must be set by the proxy
@@ -441,9 +440,18 @@ module Puppet
441
440
  :desc => "The directory in which serialized data is stored, usually in a subdirectory."},
442
441
  :reports => ["store",
443
442
  "The list of reports to generate. All reports are looked for
444
- in puppet/reports/name.rb, and multiple report names should be
443
+ in `puppet/reports/name.rb`, and multiple report names should be
445
444
  comma-separated (whitespace is okay)."
446
445
  ],
446
+ :reportdir => {:default => "$vardir/reports",
447
+ :mode => 0750,
448
+ :owner => "service",
449
+ :group => "service",
450
+ :desc => "The directory in which to store reports
451
+ received from the client. Each client gets a separate
452
+ subdirectory."},
453
+ :reporturl => ["http://localhost:3000/reports",
454
+ "The URL used by the http reports processor to send reports"],
447
455
  :fileserverconfig => ["$confdir/fileserver.conf", "Where the fileserver configuration is stored."],
448
456
  :rrddir => {:default => "$vardir/rrd",
449
457
  :owner => "service",
@@ -479,7 +487,7 @@ module Puppet
479
487
  :mode => 0644,
480
488
  :desc => "The file in which puppet agent stores a list of the classes
481
489
  associated with the retrieved configuration. Can be loaded in
482
- the separate ``puppet`` executable using the ``--loadclasses``
490
+ the separate `puppet` executable using the `--loadclasses`
483
491
  option."},
484
492
  :puppetdlog => { :default => "$logdir/puppetd.log",
485
493
  :owner => "root",
@@ -496,8 +504,8 @@ module Puppet
496
504
  "How often puppet agent applies the client configuration; in seconds."],
497
505
  :listen => [false, "Whether puppet agent should listen for
498
506
  connections. If this is true, then by default only the
499
- ``runner`` server is started, which allows remote authorized
500
- and authenticated nodes to connect and trigger ``puppet agent``
507
+ `runner` server is started, which allows remote authorized
508
+ and authenticated nodes to connect and trigger `puppet agent`
501
509
  runs."],
502
510
  :ca_server => ["$server", "The server to use for certificate
503
511
  authority requests. It's a separate server because it cannot
@@ -595,7 +603,7 @@ module Puppet
595
603
  "Where Puppet should store plugins that it pulls down from the central
596
604
  server."],
597
605
  :pluginsource => ["puppet://$server/plugins",
598
- "From where to retrieve plugins. The standard Puppet ``file`` type
606
+ "From where to retrieve plugins. The standard Puppet `file` type
599
607
  is used for retrieval, so anything that is a valid file source can
600
608
  be used here."],
601
609
  :pluginsync => [false, "Whether plugins should be synced with the central server."],
@@ -607,7 +615,7 @@ module Puppet
607
615
 
608
616
  setdefaults(
609
617
  :main,
610
- :factpath => {:default => "$vardir/lib/facter/${File::PATH_SEPARATOR}$vardir/facts",
618
+ :factpath => {:default => "$vardir/lib/facter:$vardir/facts",
611
619
  :desc => "Where Puppet should look for facts. Multiple directories should
612
620
  be colon-separated, like normal PATH variables.",
613
621
 
@@ -618,20 +626,11 @@ module Puppet
618
626
  "Where Puppet should store facts that it pulls down from the central
619
627
  server."],
620
628
  :factsource => ["puppet://$server/facts/",
621
- "From where to retrieve facts. The standard Puppet ``file`` type
629
+ "From where to retrieve facts. The standard Puppet `file` type
622
630
  is used for retrieval, so anything that is a valid file source can
623
631
  be used here."],
624
632
  :factsync => [false, "Whether facts should be synced with the central server."],
625
- :factsignore => [".svn CVS", "What files to ignore when pulling down facts."],
626
- :reportdir => {:default => "$vardir/reports",
627
- :mode => 0750,
628
- :owner => "service",
629
- :group => "service",
630
- :desc => "The directory in which to store reports
631
- received from the client. Each client gets a separate
632
- subdirectory."},
633
- :reporturl => ["http://localhost:3000/reports",
634
- "The URL used by the http reports processor to send reports"]
633
+ :factsignore => [".svn CVS", "What files to ignore when pulling down facts."]
635
634
  )
636
635
 
637
636
 
@@ -644,7 +643,6 @@ module Puppet
644
643
  :smtpserver => ["none", "The server through which to send email reports."]
645
644
  )
646
645
 
647
-
648
646
  setdefaults(
649
647
  :rails,
650
648
  :dblocation => { :default => "$statedir/clientconfigs.sqlite3",
@@ -678,18 +676,16 @@ module Puppet
678
676
  },
679
677
 
680
678
  :rails_loglevel => ["info", "The log level for Rails connections. The value must be
681
- a valid log level within Rails. Production environments normally use ``info``
682
- and other environments normally use ``debug``."]
679
+ a valid log level within Rails. Production environments normally use `info`
680
+ and other environments normally use `debug`."]
683
681
  )
684
682
 
685
-
686
683
  setdefaults(
687
684
  :couchdb,
688
685
 
689
686
  :couchdb_url => ["http://127.0.0.1:5984/puppet", "The url where the puppet couchdb database will be created"]
690
687
  )
691
688
 
692
-
693
689
  setdefaults(
694
690
  :transaction,
695
691
  :tags => ["", "Tags to use to find resources. If this is set, then
@@ -704,21 +700,19 @@ module Puppet
704
700
  ]
705
701
  )
706
702
 
707
-
708
703
  setdefaults(
709
704
  :main,
710
705
  :external_nodes => ["none",
711
706
 
712
707
  "An external command that can produce node information. The output
713
708
  must be a YAML dump of a hash, and that hash must have one or both of
714
- ``classes`` and ``parameters``, where ``classes`` is an array and
715
- ``parameters`` is a hash. For unknown nodes, the commands should
709
+ `classes` and `parameters`, where `classes` is an array and
710
+ `parameters` is a hash. For unknown nodes, the commands should
716
711
  exit with a non-zero exit code.
717
712
 
718
713
  This command makes it straightforward to store your node mapping
719
714
  information in other data sources like databases."])
720
715
 
721
-
722
716
  setdefaults(
723
717
  :ldap,
724
718
  :ldapnodes => [false,
@@ -733,9 +727,9 @@ module Puppet
733
727
  Defaults to false because TLS usually requires certificates
734
728
  to be set up on the client side."],
735
729
  :ldapserver => ["ldap",
736
- "The LDAP server. Only used if ``ldapnodes`` is enabled."],
730
+ "The LDAP server. Only used if `ldapnodes` is enabled."],
737
731
  :ldapport => [389,
738
- "The LDAP port. Only used if ``ldapnodes`` is enabled."],
732
+ "The LDAP port. Only used if `ldapnodes` is enabled."],
739
733
 
740
734
  :ldapstring => ["(&(objectclass=puppetClient)(cn=%s))",
741
735
  "The search string used to find an LDAP node."],