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
@@ -57,7 +57,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph
57
57
  end
58
58
 
59
59
  def title_key_for_ref( ref )
60
- ref =~ /^([\w:]+)\[(.*)\]$/m
60
+ ref =~ /^([-\w:]+)\[(.*)\]$/m
61
61
  [$1, $2]
62
62
  end
63
63
 
@@ -69,6 +69,7 @@ class Puppet::Resource::Type
69
69
  end
70
70
 
71
71
  scope = subscope(scope, resource) unless resource.title == :main
72
+ scope.compiler.add_class(name) unless definition?
72
73
 
73
74
  set_resource_parameters(resource, scope)
74
75
 
@@ -174,12 +175,29 @@ class Puppet::Resource::Type
174
175
  @name.is_a?(Regexp)
175
176
  end
176
177
 
178
+ # MQR TODO:
179
+ #
180
+ # The change(s) introduced by the fix for #4270 are mostly silly & should be
181
+ # removed, though we didn't realize it at the time. If it can be established/
182
+ # ensured that nodes never call parent_type and that resource_types are always
183
+ # (as they should be) members of exactly one resource_type_collection the
184
+ # following method could / should be replaced with:
185
+ #
186
+ # def parent_type
187
+ # @parent_type ||= parent && (
188
+ # resource_type_collection.find_or_load([name],parent,type.to_sym) ||
189
+ # fail Puppet::ParseError, "Could not find parent resource type '#{parent}' of type #{type} in #{resource_type_collection.environment}"
190
+ # )
191
+ # end
192
+ #
193
+ # ...and then the rest of the changes around passing in scope reverted.
194
+ #
177
195
  def parent_type(scope = nil)
178
196
  return nil unless parent
179
197
 
180
198
  unless @parent_type
181
199
  raise "Must pass scope to parent_type when called first time" unless scope
182
- unless @parent_type = scope.environment.known_resource_types.send("find_#{type}", scope.namespaces, parent)
200
+ unless @parent_type = scope.environment.known_resource_types.send("find_#{type}", [name], parent)
183
201
  fail Puppet::ParseError, "Could not find parent resource type '#{parent}' of type #{type} in #{scope.environment}"
184
202
  end
185
203
  end
@@ -215,8 +233,13 @@ class Puppet::Resource::Type
215
233
  resource[param] = value
216
234
  end
217
235
 
218
- scope.setvar("title", resource.title) unless set.include? :title
219
- scope.setvar("name", resource.name) unless set.include? :name
236
+ if @type == :hostclass
237
+ scope.setvar("title", resource.title.to_s.downcase) unless set.include? :title
238
+ scope.setvar("name", resource.name.to_s.downcase ) unless set.include? :name
239
+ else
240
+ scope.setvar("title", resource.title ) unless set.include? :title
241
+ scope.setvar("name", resource.name ) unless set.include? :name
242
+ end
220
243
  scope.setvar("module_name", module_name) if module_name and ! set.include? :module_name
221
244
 
222
245
  if caller_name = scope.parent_module_name and ! set.include?(:caller_module_name)
@@ -96,8 +96,8 @@ class Puppet::Resource::TypeCollection
96
96
  #Array("") == [] for some reason
97
97
  namespaces = [namespaces] unless namespaces.is_a?(Array)
98
98
 
99
- if r = find_fully_qualified(name, type)
100
- return r
99
+ if name =~ /^::/
100
+ return send(type, name.sub(/^::/, ''))
101
101
  end
102
102
 
103
103
  namespaces.each do |namespace|
@@ -153,6 +153,7 @@ class Puppet::Resource::TypeCollection
153
153
  end
154
154
 
155
155
  def perform_initial_import
156
+ return if Puppet.settings[:ignoreimport]
156
157
  parser = Puppet::Parser::Parser.new(environment)
157
158
  if code = Puppet.settings.uninterpolated_value(:code, environment.to_s) and code != ""
158
159
  parser.string = code
@@ -197,10 +198,6 @@ class Puppet::Resource::TypeCollection
197
198
 
198
199
  private
199
200
 
200
- def find_fully_qualified(name, type)
201
- send(type, name.sub(/^::/, ''))
202
- end
203
-
204
201
  def find_partially_qualified(namespace, name, type)
205
202
  send(type, [namespace, name].join("::"))
206
203
  end
@@ -318,16 +318,15 @@ class Puppet::SimpleGraph
318
318
  # to container leaves, but that would result in many more
319
319
  # relationships.
320
320
  stage_class = Puppet::Type.type(:stage)
321
+ whit_class = Puppet::Type.type(:whit)
321
322
  containers = other.topsort.find_all { |v| (v.is_a?(type) or v.is_a?(stage_class)) and vertex?(v) }
322
323
  containers.each do |container|
323
324
  # Get the list of children from the other graph.
324
325
  children = other.adjacent(container, :direction => :out)
325
326
 
326
- # Just remove the container if it's empty.
327
- if children.empty?
328
- remove_vertex!(container)
329
- next
330
- end
327
+ # MQR TODO: Luke suggests that it should be possible to refactor the system so that
328
+ # container nodes are retained, thus obviating the need for the whit.
329
+ children = [whit_class.new(:name => container.name, :catalog => other)] if children.empty?
331
330
 
332
331
  # First create new edges for each of the :in edges
333
332
  [:in, :out].each do |dir|
@@ -72,7 +72,7 @@ class Puppet::Transaction::ResourceHarness
72
72
  resource[param] = value
73
73
  audited << param
74
74
  else
75
- resource.info "Storing newly-audited value #{current[param]} for #{param}"
75
+ resource.debug "Storing newly-audited value #{current[param]} for #{param}"
76
76
  cache(resource, param, current[param])
77
77
  end
78
78
  end
@@ -410,13 +410,15 @@ class Type
410
410
 
411
411
  property = self.newattr(name)
412
412
 
413
- begin
414
- # make sure the parameter doesn't have any errors
415
- property.value = value
416
- rescue => detail
417
- error = Puppet::Error.new("Parameter #{name} failed: #{detail}")
418
- error.set_backtrace(detail.backtrace)
419
- raise error
413
+ if property
414
+ begin
415
+ # make sure the parameter doesn't have any errors
416
+ property.value = value
417
+ rescue => detail
418
+ error = Puppet::Error.new("Parameter #{name} failed: #{detail}")
419
+ error.set_backtrace(detail.backtrace)
420
+ raise error
421
+ end
420
422
  end
421
423
 
422
424
  nil
@@ -472,6 +474,12 @@ class Type
472
474
  raise Puppet::Error, "Resource type #{self.class.name} does not support parameter #{name}"
473
475
  end
474
476
 
477
+ if provider and ! provider.class.supports_parameter?(klass)
478
+ missing = klass.required_features.find_all { |f| ! provider.class.feature?(f) }
479
+ info "Provider %s does not support features %s; not managing attribute %s" % [provider.class.name, missing.join(", "), name]
480
+ return nil
481
+ end
482
+
475
483
  return @parameters[name] if @parameters.include?(name)
476
484
 
477
485
  @parameters[name] = klass.new(:resource => self)
@@ -933,16 +941,16 @@ class Type
933
941
  newmetaparam(:schedule) do
934
942
  desc "On what schedule the object should be managed. You must create a
935
943
  schedule object, and then reference the name of that object to use
936
- that for your schedule::
944
+ that for your schedule:
937
945
 
938
- schedule { daily:
939
- period => daily,
940
- range => \"2-4\"
941
- }
946
+ schedule { daily:
947
+ period => daily,
948
+ range => \"2-4\"
949
+ }
942
950
 
943
- exec { \"/usr/bin/apt-get update\":
944
- schedule => daily
945
- }
951
+ exec { \"/usr/bin/apt-get update\":
952
+ schedule => daily
953
+ }
946
954
 
947
955
  The creation of the schedule object does not need to appear in the
948
956
  configuration before objects that use it."
@@ -1020,40 +1028,40 @@ class Type
1020
1028
 
1021
1029
  newmetaparam(:alias) do
1022
1030
  desc "Creates an alias for the object. Puppet uses this internally when you
1023
- provide a symbolic name::
1024
-
1025
- file { sshdconfig:
1026
- path => $operatingsystem ? {
1027
- solaris => \"/usr/local/etc/ssh/sshd_config\",
1028
- default => \"/etc/ssh/sshd_config\"
1029
- },
1030
- source => \"...\"
1031
- }
1031
+ provide a symbolic name:
1032
+
1033
+ file { sshdconfig:
1034
+ path => $operatingsystem ? {
1035
+ solaris => \"/usr/local/etc/ssh/sshd_config\",
1036
+ default => \"/etc/ssh/sshd_config\"
1037
+ },
1038
+ source => \"...\"
1039
+ }
1032
1040
 
1033
- service { sshd:
1034
- subscribe => file[sshdconfig]
1035
- }
1041
+ service { sshd:
1042
+ subscribe => File[sshdconfig]
1043
+ }
1036
1044
 
1037
- When you use this feature, the parser sets ``sshdconfig`` as the name,
1045
+ When you use this feature, the parser sets `sshdconfig` as the name,
1038
1046
  and the library sets that as an alias for the file so the dependency
1039
- lookup for ``sshd`` works. You can use this parameter yourself,
1047
+ lookup for `sshd` works. You can use this parameter yourself,
1040
1048
  but note that only the library can use these aliases; for instance,
1041
- the following code will not work::
1049
+ the following code will not work:
1042
1050
 
1043
- file { \"/etc/ssh/sshd_config\":
1044
- owner => root,
1045
- group => root,
1046
- alias => sshdconfig
1047
- }
1051
+ file { \"/etc/ssh/sshd_config\":
1052
+ owner => root,
1053
+ group => root,
1054
+ alias => sshdconfig
1055
+ }
1048
1056
 
1049
- file { sshdconfig:
1050
- mode => 644
1051
- }
1057
+ file { sshdconfig:
1058
+ mode => 644
1059
+ }
1052
1060
 
1053
1061
  There's no way here for the Puppet parser to know that these two stanzas
1054
1062
  should be affecting the same file.
1055
1063
 
1056
- See the `LanguageTutorial language tutorial`:trac: for more information.
1064
+ See the [Language Tutorial](http://docs.puppetlabs.com/guides/language_tutorial.html) for more information.
1057
1065
 
1058
1066
  "
1059
1067
 
@@ -1083,9 +1091,9 @@ class Type
1083
1091
  be useful to add your own tags to a given resource.
1084
1092
 
1085
1093
  Tags are currently useful for things like applying a subset of a
1086
- host's configuration::
1094
+ host's configuration:
1087
1095
 
1088
- puppet agent --test --tags mytag
1096
+ puppet agent --test --tags mytag
1089
1097
 
1090
1098
  This way, when you're testing a configuration you can run just the
1091
1099
  portion you're testing."
@@ -1189,23 +1197,23 @@ class Type
1189
1197
  newmetaparam(:require, :parent => RelationshipMetaparam, :attributes => {:direction => :in, :events => :NONE}) do
1190
1198
  desc "One or more objects that this object depends on.
1191
1199
  This is used purely for guaranteeing that changes to required objects
1192
- happen before the dependent object. For instance::
1200
+ happen before the dependent object. For instance:
1193
1201
 
1194
- # Create the destination directory before you copy things down
1195
- file { \"/usr/local/scripts\":
1196
- ensure => directory
1197
- }
1202
+ # Create the destination directory before you copy things down
1203
+ file { \"/usr/local/scripts\":
1204
+ ensure => directory
1205
+ }
1198
1206
 
1199
- file { \"/usr/local/scripts/myscript\":
1200
- source => \"puppet://server/module/myscript\",
1201
- mode => 755,
1202
- require => File[\"/usr/local/scripts\"]
1203
- }
1207
+ file { \"/usr/local/scripts/myscript\":
1208
+ source => \"puppet://server/module/myscript\",
1209
+ mode => 755,
1210
+ require => File[\"/usr/local/scripts\"]
1211
+ }
1204
1212
 
1205
1213
  Multiple dependencies can be specified by providing a comma-seperated list
1206
- of resources, enclosed in square brackets::
1214
+ of resources, enclosed in square brackets:
1207
1215
 
1208
- require => [ File[\"/usr/local\"], File[\"/usr/local/scripts\"] ]
1216
+ require => [ File[\"/usr/local\"], File[\"/usr/local/scripts\"] ]
1209
1217
 
1210
1218
  Note that Puppet will autorequire everything that it can, and
1211
1219
  there are hooks in place so that it's easy for resources to add new
@@ -1219,10 +1227,10 @@ class Type
1219
1227
 
1220
1228
  Currently, exec resources will autorequire their CWD (if it is
1221
1229
  specified) plus any fully qualified paths that appear in the
1222
- command. For instance, if you had an ``exec`` command that ran
1223
- the ``myscript`` mentioned above, the above code that pulls the
1230
+ command. For instance, if you had an `exec` command that ran
1231
+ the `myscript` mentioned above, the above code that pulls the
1224
1232
  file down would be automatically listed as a requirement to the
1225
- ``exec`` code, so that you would always be running againts the
1233
+ `exec` code, so that you would always be running againts the
1226
1234
  most recent version.
1227
1235
  "
1228
1236
  end
@@ -1230,20 +1238,20 @@ class Type
1230
1238
  newmetaparam(:subscribe, :parent => RelationshipMetaparam, :attributes => {:direction => :in, :events => :ALL_EVENTS, :callback => :refresh}) do
1231
1239
  desc "One or more objects that this object depends on. Changes in the
1232
1240
  subscribed to objects result in the dependent objects being
1233
- refreshed (e.g., a service will get restarted). For instance::
1234
-
1235
- class nagios {
1236
- file { \"/etc/nagios/nagios.conf\":
1237
- source => \"puppet://server/module/nagios.conf\",
1238
- alias => nagconf # just to make things easier for me
1239
- }
1240
- service { nagios:
1241
- ensure => running,
1242
- subscribe => File[nagconf]
1241
+ refreshed (e.g., a service will get restarted). For instance:
1242
+
1243
+ class nagios {
1244
+ file { \"/etc/nagios/nagios.conf\":
1245
+ source => \"puppet://server/module/nagios.conf\",
1246
+ alias => nagconf # just to make things easier for me
1247
+ }
1248
+ service { nagios:
1249
+ ensure => running,
1250
+ subscribe => File[nagconf]
1251
+ }
1243
1252
  }
1244
- }
1245
1253
 
1246
- Currently the ``exec``, ``mount`` and ``service`` type support
1254
+ Currently the `exec`, `mount` and `service` type support
1247
1255
  refreshing.
1248
1256
  "
1249
1257
  end
@@ -1251,18 +1259,18 @@ class Type
1251
1259
  newmetaparam(:before, :parent => RelationshipMetaparam, :attributes => {:direction => :out, :events => :NONE}) do
1252
1260
  desc %{This parameter is the opposite of **require** -- it guarantees
1253
1261
  that the specified object is applied later than the specifying
1254
- object::
1262
+ object:
1255
1263
 
1256
- file { "/var/nagios/configuration":
1257
- source => "...",
1258
- recurse => true,
1259
- before => Exec["nagios-rebuid"]
1260
- }
1264
+ file { "/var/nagios/configuration":
1265
+ source => "...",
1266
+ recurse => true,
1267
+ before => Exec["nagios-rebuid"]
1268
+ }
1261
1269
 
1262
- exec { "nagios-rebuild":
1263
- command => "/usr/bin/make",
1264
- cwd => "/var/nagios/configuration"
1265
- }
1270
+ exec { "nagios-rebuild":
1271
+ command => "/usr/bin/make",
1272
+ cwd => "/var/nagios/configuration"
1273
+ }
1266
1274
 
1267
1275
  This will make sure all of the files are up to date before the
1268
1276
  make command is run.}
@@ -1270,16 +1278,16 @@ class Type
1270
1278
 
1271
1279
  newmetaparam(:notify, :parent => RelationshipMetaparam, :attributes => {:direction => :out, :events => :ALL_EVENTS, :callback => :refresh}) do
1272
1280
  desc %{This parameter is the opposite of **subscribe** -- it sends events
1273
- to the specified object::
1281
+ to the specified object:
1274
1282
 
1275
- file { "/etc/sshd_config":
1276
- source => "....",
1277
- notify => Service[sshd]
1278
- }
1283
+ file { "/etc/sshd_config":
1284
+ source => "....",
1285
+ notify => Service[sshd]
1286
+ }
1279
1287
 
1280
- service { sshd:
1281
- ensure => running
1282
- }
1288
+ service { sshd:
1289
+ ensure => running
1290
+ }
1283
1291
 
1284
1292
  This will restart the sshd service if the sshd config file changes.}
1285
1293
  end
@@ -1293,24 +1301,24 @@ class Type
1293
1301
  By default, all classes get directly added to the
1294
1302
  'main' stage. You can create new stages as resources:
1295
1303
 
1296
- stage { [pre, post]: }
1304
+ stage { [pre, post]: }
1297
1305
 
1298
1306
  To order stages, use standard relationships:
1299
1307
 
1300
- stage { pre: before => Stage[main] }
1308
+ stage { pre: before => Stage[main] }
1301
1309
 
1302
1310
  Or use the new relationship syntax:
1303
1311
 
1304
- Stage[pre] -> Stage[main] -> Stage[post]
1312
+ Stage[pre] -> Stage[main] -> Stage[post]
1305
1313
 
1306
1314
  Then use the new class parameters to specify a stage:
1307
1315
 
1308
- class { foo: stage => pre }
1316
+ class { foo: stage => pre }
1309
1317
 
1310
1318
  Stages can only be set on classes, not individual resources. This will
1311
- fail::
1319
+ fail:
1312
1320
 
1313
- file { '/foo': stage => pre, ensure => file }
1321
+ file { '/foo': stage => pre, ensure => file }
1314
1322
  }
1315
1323
  end
1316
1324
 
@@ -28,27 +28,28 @@ Puppet::Type.newtype(:augeas) do
28
28
  via the augeas tool.
29
29
 
30
30
  Requires:
31
- - augeas to be installed (http://www.augeas.net)
32
- - ruby-augeas bindings
33
31
 
34
- Sample usage with a string::
32
+ - augeas to be installed (http://www.augeas.net)
33
+ - ruby-augeas bindings
35
34
 
36
- augeas{\"test1\" :
37
- context => \"/files/etc/sysconfig/firstboot\",
38
- changes => \"set RUN_FIRSTBOOT YES\",
39
- onlyif => \"match other_value size > 0\",
40
- }
35
+ Sample usage with a string:
41
36
 
42
- Sample usage with an array and custom lenses::
37
+ augeas{\"test1\" :
38
+ context => \"/files/etc/sysconfig/firstboot\",
39
+ changes => \"set RUN_FIRSTBOOT YES\",
40
+ onlyif => \"match other_value size > 0\",
41
+ }
43
42
 
44
- augeas{\"jboss_conf\":
45
- context => \"/files\",
46
- changes => [
47
- \"set /etc/jbossas/jbossas.conf/JBOSS_IP $ipaddress\",
48
- \"set /etc/jbossas/jbossas.conf/JAVA_HOME /usr\"
49
- ],
50
- load_path => \"$/usr/share/jbossas/lenses\",
51
- }
43
+ Sample usage with an array and custom lenses:
44
+
45
+ augeas{\"jboss_conf\":
46
+ context => \"/files\",
47
+ changes => [
48
+ \"set /etc/jbossas/jbossas.conf/JBOSS_IP $ipaddress\",
49
+ \"set /etc/jbossas/jbossas.conf/JAVA_HOME /usr\"
50
+ ],
51
+ load_path => \"$/usr/share/jbossas/lenses\",
52
+ }
52
53
 
53
54
  "
54
55
 
@@ -71,23 +72,23 @@ Puppet::Type.newtype(:augeas) do
71
72
 
72
73
  newparam (:onlyif) do
73
74
  desc "Optional augeas command and comparisons to control the execution of this type.
74
- Supported onlyif syntax::
75
-
76
- get [AUGEAS_PATH] [COMPARATOR] [STRING]
77
- match [MATCH_PATH] size [COMPARATOR] [INT]
78
- match [MATCH_PATH] include [STRING]
79
- match [MATCH_PATH] not_include [STRING]
80
- match [MATCH_PATH] == [AN_ARRAY]
81
- match [MATCH_PATH] != [AN_ARRAY]
82
-
83
- where::
84
-
85
- AUGEAS_PATH is a valid path scoped by the context
86
- MATCH_PATH is a valid match synatx scoped by the context
87
- COMPARATOR is in the set [> >= != == <= <]
88
- STRING is a string
89
- INT is a number
90
- AN_ARRAY is in the form ['a string', 'another']"
75
+ Supported onlyif syntax:
76
+
77
+ get [AUGEAS_PATH] [COMPARATOR] [STRING]
78
+ match [MATCH_PATH] size [COMPARATOR] [INT]
79
+ match [MATCH_PATH] include [STRING]
80
+ match [MATCH_PATH] not_include [STRING]
81
+ match [MATCH_PATH] == [AN_ARRAY]
82
+ match [MATCH_PATH] != [AN_ARRAY]
83
+
84
+ where:
85
+
86
+ AUGEAS_PATH is a valid path scoped by the context
87
+ MATCH_PATH is a valid match synatx scoped by the context
88
+ COMPARATOR is in the set [> >= != == <= <]
89
+ STRING is a string
90
+ INT is a number
91
+ AN_ARRAY is in the form ['a string', 'another']"
91
92
  defaultto ""
92
93
  end
93
94
 
@@ -95,16 +96,14 @@ Puppet::Type.newtype(:augeas) do
95
96
  newparam(:changes) do
96
97
  desc "The changes which should be applied to the filesystem. This
97
98
  can be either a string which contains a command or an array of commands.
98
- Commands supported are::
99
+ Commands supported are:
99
100
 
100
- set [PATH] [VALUE] Sets the value VALUE at loction PATH
101
- rm [PATH] Removes the node at location PATH
102
- remove [PATH] Synonym for rm
103
- clear [PATH] Keeps the node at PATH, but removes the value.
104
- ins [LABEL] [WHERE] [PATH]
105
- Inserts an empty node LABEL either [WHERE={before|after}] PATH.
106
- insert [LABEL] [WHERE] [PATH]
107
- Synonym for ins
101
+ set [PATH] [VALUE] Sets the value VALUE at loction PATH
102
+ rm [PATH] Removes the node at location PATH
103
+ remove [PATH] Synonym for rm
104
+ clear [PATH] Keeps the node at PATH, but removes the value.
105
+ ins [LABEL] [WHERE] [PATH] Inserts an empty node LABEL either [WHERE={before|after}] PATH.
106
+ insert [LABEL] [WHERE] [PATH] Synonym for ins
108
107
 
109
108
  If the parameter 'context' is set that value is prepended to PATH"
110
109
  end
@@ -136,11 +135,11 @@ Puppet::Type.newtype(:augeas) do
136
135
  end
137
136
 
138
137
  newparam(:lens) do
139
- 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"
138
+ 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"
140
139
  end
141
140
 
142
141
  newparam(:incl) do
143
- 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."
142
+ 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."
144
143
  end
145
144
 
146
145
  validate do