bolt 0.17.1 → 0.17.2

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

Potentially problematic release.


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

Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +25 -13
  3. data/lib/bolt/cli.rb +45 -15
  4. data/lib/bolt/config.rb +48 -132
  5. data/lib/bolt/executor.rb +3 -10
  6. data/lib/bolt/inventory.rb +15 -1
  7. data/lib/bolt/puppetdb.rb +11 -0
  8. data/lib/bolt/puppetdb/client.rb +68 -0
  9. data/lib/bolt/puppetdb/config.rb +76 -0
  10. data/lib/bolt/target.rb +5 -4
  11. data/lib/bolt/transport/base.rb +11 -2
  12. data/lib/bolt/transport/local.rb +11 -5
  13. data/lib/bolt/transport/orch.rb +16 -5
  14. data/lib/bolt/transport/ssh.rb +32 -1
  15. data/lib/bolt/transport/ssh/connection.rb +17 -10
  16. data/lib/bolt/transport/winrm.rb +18 -1
  17. data/lib/bolt/transport/winrm/connection.rb +15 -16
  18. data/lib/bolt/util.rb +15 -0
  19. data/lib/bolt/version.rb +1 -1
  20. data/lib/bolt_ext/puppetdb_inventory.rb +5 -135
  21. data/vendored/facter/lib/facter/ec2/rest.rb +1 -1
  22. data/vendored/hiera/lib/hiera/version.rb +1 -1
  23. data/vendored/puppet/lib/puppet/application/agent.rb +1 -3
  24. data/vendored/puppet/lib/puppet/application/apply.rb +2 -4
  25. data/vendored/puppet/lib/puppet/application/cert.rb +6 -1
  26. data/vendored/puppet/lib/puppet/application/device.rb +100 -13
  27. data/vendored/puppet/lib/puppet/application/facts.rb +5 -0
  28. data/vendored/puppet/lib/puppet/application/lookup.rb +11 -1
  29. data/vendored/puppet/lib/puppet/configurer.rb +17 -4
  30. data/vendored/puppet/lib/puppet/configurer/plugin_handler.rb +1 -1
  31. data/vendored/puppet/lib/puppet/datatypes.rb +1 -1
  32. data/vendored/puppet/lib/puppet/defaults.rb +1 -1
  33. data/vendored/puppet/lib/puppet/environments.rb +2 -2
  34. data/vendored/puppet/lib/puppet/error.rb +6 -3
  35. data/vendored/puppet/lib/puppet/external/dot.rb +0 -7
  36. data/vendored/puppet/lib/puppet/external/nagios/parser.rb +1 -1
  37. data/vendored/puppet/lib/puppet/face/config.rb +41 -8
  38. data/vendored/puppet/lib/puppet/face/epp.rb +30 -5
  39. data/vendored/puppet/lib/puppet/face/facts.rb +49 -0
  40. data/vendored/puppet/lib/puppet/face/help.rb +33 -35
  41. data/vendored/puppet/lib/puppet/face/man.rb +55 -12
  42. data/vendored/puppet/lib/puppet/face/parser.rb +30 -3
  43. data/vendored/puppet/lib/puppet/file_bucket/file.rb +0 -2
  44. data/vendored/puppet/lib/puppet/file_serving/base.rb +10 -10
  45. data/vendored/puppet/lib/puppet/functions.rb +1 -3
  46. data/vendored/puppet/lib/puppet/functions/alert.rb +1 -1
  47. data/vendored/puppet/lib/puppet/functions/all.rb +6 -6
  48. data/vendored/puppet/lib/puppet/functions/annotate.rb +10 -10
  49. data/vendored/puppet/lib/puppet/functions/any.rb +6 -6
  50. data/vendored/puppet/lib/puppet/functions/assert_type.rb +4 -4
  51. data/vendored/puppet/lib/puppet/functions/binary_file.rb +14 -2
  52. data/vendored/puppet/lib/puppet/functions/break.rb +31 -2
  53. data/vendored/puppet/lib/puppet/functions/call.rb +4 -4
  54. data/vendored/puppet/lib/puppet/functions/contain.rb +19 -3
  55. data/vendored/puppet/lib/puppet/functions/convert_to.rb +6 -5
  56. data/vendored/puppet/lib/puppet/functions/crit.rb +1 -1
  57. data/vendored/puppet/lib/puppet/functions/debug.rb +1 -1
  58. data/vendored/puppet/lib/puppet/functions/defined.rb +11 -9
  59. data/vendored/puppet/lib/puppet/functions/dig.rb +26 -2
  60. data/vendored/puppet/lib/puppet/functions/each.rb +8 -8
  61. data/vendored/puppet/lib/puppet/functions/emerg.rb +1 -1
  62. data/vendored/puppet/lib/puppet/functions/empty.rb +79 -0
  63. data/vendored/puppet/lib/puppet/functions/err.rb +1 -1
  64. data/vendored/puppet/lib/puppet/functions/filter.rb +7 -7
  65. data/vendored/puppet/lib/puppet/functions/find_file.rb +15 -1
  66. data/vendored/puppet/lib/puppet/functions/flatten.rb +64 -0
  67. data/vendored/puppet/lib/puppet/functions/hiera.rb +6 -6
  68. data/vendored/puppet/lib/puppet/functions/hiera_array.rb +6 -6
  69. data/vendored/puppet/lib/puppet/functions/hiera_hash.rb +6 -6
  70. data/vendored/puppet/lib/puppet/functions/hiera_include.rb +8 -8
  71. data/vendored/puppet/lib/puppet/functions/include.rb +28 -2
  72. data/vendored/puppet/lib/puppet/functions/info.rb +1 -1
  73. data/vendored/puppet/lib/puppet/functions/inline_epp.rb +2 -2
  74. data/vendored/puppet/lib/puppet/functions/join.rb +56 -0
  75. data/vendored/puppet/lib/puppet/functions/keys.rb +25 -0
  76. data/vendored/puppet/lib/puppet/functions/length.rb +44 -0
  77. data/vendored/puppet/lib/puppet/functions/lest.rb +39 -1
  78. data/vendored/puppet/lib/puppet/functions/map.rb +10 -9
  79. data/vendored/puppet/lib/puppet/functions/match.rb +6 -6
  80. data/vendored/puppet/lib/puppet/functions/new.rb +995 -2
  81. data/vendored/puppet/lib/puppet/functions/next.rb +1 -1
  82. data/vendored/puppet/lib/puppet/functions/notice.rb +1 -1
  83. data/vendored/puppet/lib/puppet/functions/reduce.rb +6 -6
  84. data/vendored/puppet/lib/puppet/functions/regsubst.rb +9 -3
  85. data/vendored/puppet/lib/puppet/functions/require.rb +36 -2
  86. data/vendored/puppet/lib/puppet/functions/return.rb +1 -1
  87. data/vendored/puppet/lib/puppet/functions/reverse_each.rb +71 -2
  88. data/vendored/puppet/lib/puppet/functions/slice.rb +23 -9
  89. data/vendored/puppet/lib/puppet/functions/split.rb +12 -10
  90. data/vendored/puppet/lib/puppet/functions/step.rb +73 -1
  91. data/vendored/puppet/lib/puppet/functions/strftime.rb +176 -2
  92. data/vendored/puppet/lib/puppet/functions/then.rb +65 -2
  93. data/vendored/puppet/lib/puppet/functions/tree_each.rb +19 -19
  94. data/vendored/puppet/lib/puppet/functions/type.rb +42 -1
  95. data/vendored/puppet/lib/puppet/functions/unique.rb +13 -13
  96. data/vendored/puppet/lib/puppet/functions/unwrap.rb +8 -4
  97. data/vendored/puppet/lib/puppet/functions/values.rb +25 -0
  98. data/vendored/puppet/lib/puppet/functions/versioncmp.rb +1 -1
  99. data/vendored/puppet/lib/puppet/functions/warning.rb +1 -1
  100. data/vendored/puppet/lib/puppet/functions/with.rb +6 -4
  101. data/vendored/puppet/lib/puppet/indirector/certificate_status/file.rb +1 -1
  102. data/vendored/puppet/lib/puppet/indirector/facts/facter.rb +1 -3
  103. data/vendored/puppet/lib/puppet/indirector/facts/rest.rb +21 -0
  104. data/vendored/puppet/lib/puppet/indirector/facts/yaml.rb +0 -4
  105. data/vendored/puppet/lib/puppet/indirector/file_content/http.rb +3 -1
  106. data/vendored/puppet/lib/puppet/indirector/indirection.rb +5 -3
  107. data/vendored/puppet/lib/puppet/indirector/request.rb +6 -2
  108. data/vendored/puppet/lib/puppet/module/task.rb +2 -2
  109. data/vendored/puppet/lib/puppet/module_tool/tar/mini.rb +57 -4
  110. data/vendored/puppet/lib/puppet/network/authconfig.rb +1 -1
  111. data/vendored/puppet/lib/puppet/network/http/api/indirected_routes.rb +1 -0
  112. data/vendored/puppet/lib/puppet/network/resolver.rb +1 -2
  113. data/vendored/puppet/lib/puppet/node.rb +4 -3
  114. data/vendored/puppet/lib/puppet/parser/compiler.rb +12 -5
  115. data/vendored/puppet/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +1 -1
  116. data/vendored/puppet/lib/puppet/parser/functions/fqdn_rand.rb +15 -4
  117. data/vendored/puppet/lib/puppet/parser/functions/new.rb +31 -46
  118. data/vendored/puppet/lib/puppet/parser/parser_factory.rb +1 -1
  119. data/vendored/puppet/lib/puppet/parser/resource.rb +1 -1
  120. data/vendored/puppet/lib/puppet/parser/type_loader.rb +11 -11
  121. data/vendored/puppet/lib/puppet/pops/evaluator/closure.rb +1 -1
  122. data/vendored/puppet/lib/puppet/pops/evaluator/collector_transformer.rb +1 -1
  123. data/vendored/puppet/lib/puppet/pops/evaluator/epp_evaluator.rb +2 -2
  124. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_resource_support.rb +2 -2
  125. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +5 -2
  126. data/vendored/puppet/lib/puppet/pops/functions/dispatch.rb +1 -1
  127. data/vendored/puppet/lib/puppet/pops/issue_reporter.rb +18 -1
  128. data/vendored/puppet/lib/puppet/pops/issues.rb +6 -3
  129. data/vendored/puppet/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +1 -2
  130. data/vendored/puppet/lib/puppet/pops/loader/ruby_function_instantiator.rb +1 -2
  131. data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +4 -4
  132. data/vendored/puppet/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -1
  133. data/vendored/puppet/lib/puppet/pops/loaders.rb +18 -7
  134. data/vendored/puppet/lib/puppet/pops/lookup/global_data_provider.rb +1 -1
  135. data/vendored/puppet/lib/puppet/pops/model/factory.rb +6 -3
  136. data/vendored/puppet/lib/puppet/pops/model/model_tree_dumper.rb +4 -0
  137. data/vendored/puppet/lib/puppet/pops/model/pn_transformer.rb +400 -0
  138. data/vendored/puppet/lib/puppet/pops/parser/eparser.rb +1 -1
  139. data/vendored/puppet/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  140. data/vendored/puppet/lib/puppet/pops/parser/lexer_support.rb +3 -2
  141. data/vendored/puppet/lib/puppet/pops/parser/locator.rb +0 -2
  142. data/vendored/puppet/lib/puppet/pops/parser/pn_parser.rb +316 -0
  143. data/vendored/puppet/lib/puppet/pops/pcore.rb +17 -17
  144. data/vendored/puppet/lib/puppet/pops/pn.rb +236 -0
  145. data/vendored/puppet/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  146. data/vendored/puppet/lib/puppet/pops/types/class_loader.rb +6 -3
  147. data/vendored/puppet/lib/puppet/pops/types/implementation_registry.rb +28 -35
  148. data/vendored/puppet/lib/puppet/pops/types/p_object_type.rb +3 -3
  149. data/vendored/puppet/lib/puppet/pops/types/p_timespan_type.rb +2 -2
  150. data/vendored/puppet/lib/puppet/pops/types/p_type_set_type.rb +24 -1
  151. data/vendored/puppet/lib/puppet/pops/types/ruby_generator.rb +3 -4
  152. data/vendored/puppet/lib/puppet/pops/types/type_calculator.rb +1 -1
  153. data/vendored/puppet/lib/puppet/pops/types/type_factory.rb +0 -4
  154. data/vendored/puppet/lib/puppet/pops/types/type_mismatch_describer.rb +1 -1
  155. data/vendored/puppet/lib/puppet/pops/types/type_parser.rb +14 -7
  156. data/vendored/puppet/lib/puppet/pops/types/types.rb +1 -1
  157. data/vendored/puppet/lib/puppet/pops/utils.rb +2 -2
  158. data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +6 -2
  159. data/vendored/puppet/lib/puppet/provider/group/groupadd.rb +3 -1
  160. data/vendored/puppet/lib/puppet/provider/group/windows_adsi.rb +4 -7
  161. data/vendored/puppet/lib/puppet/provider/nameservice.rb +3 -3
  162. data/vendored/puppet/lib/puppet/provider/package/dnf.rb +1 -1
  163. data/vendored/puppet/lib/puppet/provider/package/gem.rb +1 -1
  164. data/vendored/puppet/lib/puppet/provider/package/pacman.rb +4 -4
  165. data/vendored/puppet/lib/puppet/provider/package/pip.rb +3 -3
  166. data/vendored/puppet/lib/puppet/provider/package/pkgdmg.rb +3 -3
  167. data/vendored/puppet/lib/puppet/provider/package/pkgutil.rb +2 -2
  168. data/vendored/puppet/lib/puppet/provider/package/portage.rb +9 -9
  169. data/vendored/puppet/lib/puppet/provider/package/zypper.rb +2 -2
  170. data/vendored/puppet/lib/puppet/provider/service/base.rb +1 -1
  171. data/vendored/puppet/lib/puppet/provider/service/smf.rb +3 -2
  172. data/vendored/puppet/lib/puppet/provider/user/useradd.rb +6 -2
  173. data/vendored/puppet/lib/puppet/provider/user/windows_adsi.rb +1 -1
  174. data/vendored/puppet/lib/puppet/provider/zfs/zfs.rb +3 -2
  175. data/vendored/puppet/lib/puppet/reference/configuration.rb +2 -0
  176. data/vendored/puppet/lib/puppet/reference/type.rb +11 -11
  177. data/vendored/puppet/lib/puppet/resource.rb +1 -1
  178. data/vendored/puppet/lib/puppet/resource/capability_finder.rb +2 -2
  179. data/vendored/puppet/lib/puppet/resource/catalog.rb +2 -2
  180. data/vendored/puppet/lib/puppet/resource/status.rb +9 -2
  181. data/vendored/puppet/lib/puppet/resource/type.rb +1 -1
  182. data/vendored/puppet/lib/puppet/settings.rb +31 -19
  183. data/vendored/puppet/lib/puppet/settings/base_setting.rb +5 -0
  184. data/vendored/puppet/lib/puppet/settings/config_file.rb +1 -1
  185. data/vendored/puppet/lib/puppet/settings/ttl_setting.rb +5 -0
  186. data/vendored/puppet/lib/puppet/ssl/certificate_factory.rb +2 -2
  187. data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +0 -2
  188. data/vendored/puppet/lib/puppet/transaction/additional_resource_generator.rb +2 -2
  189. data/vendored/puppet/lib/puppet/transaction/event.rb +1 -1
  190. data/vendored/puppet/lib/puppet/transaction/report.rb +1 -1
  191. data/vendored/puppet/lib/puppet/type.rb +9 -13
  192. data/vendored/puppet/lib/puppet/type/augeas.rb +2 -2
  193. data/vendored/puppet/lib/puppet/type/cron.rb +11 -6
  194. data/vendored/puppet/lib/puppet/type/exec.rb +1 -1
  195. data/vendored/puppet/lib/puppet/type/file.rb +4 -5
  196. data/vendored/puppet/lib/puppet/type/host.rb +1 -1
  197. data/vendored/puppet/lib/puppet/type/k5login.rb +30 -54
  198. data/vendored/puppet/lib/puppet/type/package.rb +3 -3
  199. data/vendored/puppet/lib/puppet/type/schedule.rb +12 -12
  200. data/vendored/puppet/lib/puppet/type/scheduled_task.rb +2 -2
  201. data/vendored/puppet/lib/puppet/type/ssh_authorized_key.rb +5 -5
  202. data/vendored/puppet/lib/puppet/type/sshkey.rb +2 -2
  203. data/vendored/puppet/lib/puppet/type/tidy.rb +9 -2
  204. data/vendored/puppet/lib/puppet/type/user.rb +1 -1
  205. data/vendored/puppet/lib/puppet/type/yumrepo.rb +25 -4
  206. data/vendored/puppet/lib/puppet/type/zfs.rb +4 -0
  207. data/vendored/puppet/lib/puppet/util.rb +0 -4
  208. data/vendored/puppet/lib/puppet/util/backups.rb +1 -1
  209. data/vendored/puppet/lib/puppet/util/http_proxy.rb +4 -2
  210. data/vendored/puppet/lib/puppet/util/inifile.rb +3 -4
  211. data/vendored/puppet/lib/puppet/util/log.rb +2 -5
  212. data/vendored/puppet/lib/puppet/util/network_device/cisco/facts.rb +1 -1
  213. data/vendored/puppet/lib/puppet/util/reference.rb +1 -8
  214. data/vendored/puppet/lib/puppet/util/tagging.rb +1 -1
  215. data/vendored/puppet/lib/puppet/util/warnings.rb +0 -2
  216. data/vendored/puppet/lib/puppet/util/windows/adsi.rb +15 -18
  217. data/vendored/puppet/lib/puppet/util/windows/com.rb +2 -1
  218. data/vendored/puppet/lib/puppet/util/windows/file.rb +2 -2
  219. data/vendored/puppet/lib/puppet/util/windows/principal.rb +7 -6
  220. data/vendored/puppet/lib/puppet/util/windows/sid.rb +60 -7
  221. data/vendored/puppet/lib/puppet/util/windows/taskscheduler.rb +0 -9
  222. data/vendored/puppet/lib/puppet/version.rb +1 -1
  223. data/vendored/puppet/lib/puppet_pal.rb +53 -48
  224. metadata +15 -2
@@ -9,8 +9,8 @@ require 'puppet/parameter/boolean'
9
9
  module Puppet
10
10
  Type.newtype(:package) do
11
11
  @doc = "Manage packages. There is a basic dichotomy in package
12
- support right now: Some package types (e.g., yum and apt) can
13
- retrieve their own package files, while others (e.g., rpm and sun)
12
+ support right now: Some package types (such as yum and apt) can
13
+ retrieve their own package files, while others (such as rpm and sun)
14
14
  cannot. For those package formats that cannot retrieve their own files,
15
15
  you can use the `source` parameter to point to the correct file.
16
16
 
@@ -242,7 +242,7 @@ module Puppet
242
242
  name => $ssl,
243
243
  }
244
244
 
245
- . etc. .
245
+ ...
246
246
 
247
247
  $ssh = $operatingsystem ? {
248
248
  solaris => SMCossh,
@@ -18,8 +18,8 @@ module Puppet
18
18
  time within that schedule, then the resources will get applied;
19
19
  otherwise, that work may never get done.
20
20
 
21
- Thus, it is advisable to use wider scheduling (e.g., over a couple of
22
- hours) combined with periods and repetitions. For instance, if you
21
+ Thus, it is advisable to use wider scheduling (for example, over a couple
22
+ of hours) combined with periods and repetitions. For instance, if you
23
23
  wanted to restrict certain resources to only running once, between
24
24
  the hours of two and 4 AM, then you would use this schedule:
25
25
 
@@ -36,7 +36,7 @@ module Puppet
36
36
  because they will be outside the scheduled range.
37
37
 
38
38
  Puppet automatically creates a schedule for each of the valid periods
39
- with the same name as that period (e.g., hourly and daily).
39
+ with the same name as that period (such as hourly and daily).
40
40
  Additionally, a schedule named `puppet` is created and used as the
41
41
  default, with the following attributes:
42
42
 
@@ -83,7 +83,7 @@ module Puppet
83
83
  This is mostly useful for restricting certain resources to being
84
84
  applied in maintenance windows or during off-peak hours. Multiple
85
85
  ranges can be applied in array context. As a convenience when specifying
86
- ranges, you may cross midnight (e.g.: range => "22:00 - 04:00").
86
+ ranges, you can cross midnight (for example, `range => "22:00 - 04:00"`).
87
87
  EOT
88
88
 
89
89
  # This is lame; properties all use arrays as values, but parameters don't.
@@ -225,9 +225,9 @@ module Puppet
225
225
  end
226
226
 
227
227
  newparam(:periodmatch) do
228
- desc "Whether periods should be matched by number (e.g., the two times
229
- are in the same hour) or by distance (e.g., the two times are
230
- 60 minutes apart)."
228
+ desc "Whether periods should be matched by a numeric value (for instance,
229
+ whether two times are in the same hour) or by their chronological
230
+ distance apart (whether two times are 60 minutes apart)."
231
231
 
232
232
  newvalues(:number, :distance)
233
233
 
@@ -241,8 +241,8 @@ module Puppet
241
241
 
242
242
  Note that the period defines how often a given resource will get
243
243
  applied but not when; if you would like to restrict the hours
244
- that a given resource can be applied (e.g., only at night during
245
- a maintenance window), then use the `range` attribute.
244
+ that a given resource can be applied (for instance, only at night
245
+ during a maintenance window), then use the `range` attribute.
246
246
 
247
247
  If the provided periods are not sufficient, you can provide a
248
248
  value to the *repeat* attribute, which will cause Puppet to
@@ -258,9 +258,9 @@ module Puppet
258
258
 
259
259
  At the moment, Puppet cannot guarantee that level of repetition; that
260
260
  is, the resource can applied _up to_ every 10 minutes, but internal
261
- factors might prevent it from actually running that often (e.g. if a
262
- Puppet run is still in progress when the next run is scheduled to start,
263
- that next run will be suppressed).
261
+ factors might prevent it from actually running that often (for instance,
262
+ if a Puppet run is still in progress when the next run is scheduled to
263
+ start, that next run will be suppressed).
264
264
 
265
265
  See the `periodmatch` attribute for tuning whether to match
266
266
  times by their distance apart or by their specific value.
@@ -107,10 +107,10 @@ Puppet::Type.newtype(:scheduled_task) do
107
107
  minutes_interval.
108
108
  * For `daily` triggers:
109
109
  * `every` --- How often the task should run, as a number of days. Defaults
110
- to 1. ("2" means every other day, "3" means every three days, etc.)
110
+ to 1. ("2" means every other day, "3" means every three days, and so on)
111
111
  * For `weekly` triggers:
112
112
  * `every` --- How often the task should run, as a number of weeks. Defaults
113
- to 1. ("2" means every other week, "3" means every three weeks, etc.)
113
+ to 1. ("2" means every other week, "3" means every three weeks, and so on)
114
114
  * `day_of_week` --- Which days of the week the task should run, as an array.
115
115
  Defaults to all days. Each day must be one of `mon`, `tues`,
116
116
  `wed`, `thurs`, `fri`, `sat`, `sun`, or `all`.
@@ -66,8 +66,8 @@ module Puppet
66
66
  Make sure to omit the following in this attribute (and specify them in
67
67
  other attributes):
68
68
 
69
- * Key headers (e.g. 'ssh-rsa') --- put these in the `type` attribute.
70
- * Key identifiers / comments (e.g. 'joe@joescomputer.local') --- put these in
69
+ * Key headers, such as 'ssh-rsa' --- put these in the `type` attribute.
70
+ * Key identifiers / comments, such as 'joe@joescomputer.local' --- put these in
71
71
  the `name` attribute/resource title."
72
72
 
73
73
  validate do |value|
@@ -82,9 +82,9 @@ module Puppet
82
82
 
83
83
  newproperty(:target) do
84
84
  desc "The absolute filename in which to store the SSH key. This
85
- property is optional and should only be used in cases where keys
86
- are stored in a non-standard location (i.e.` not in
87
- `~user/.ssh/authorized_keys`)."
85
+ property is optional and should be used only in cases where keys
86
+ are stored in a non-standard location, for instance when not in
87
+ `~user/.ssh/authorized_keys`."
88
88
 
89
89
  defaultto :absent
90
90
 
@@ -25,8 +25,8 @@ module Puppet
25
25
  Make sure to omit the following in this attribute (and specify them in
26
26
  other attributes):
27
27
 
28
- * Key headers (e.g. 'ssh-rsa') --- put these in the `type` attribute.
29
- * Key identifiers / comments (e.g. 'joescomputer.local') --- put these in
28
+ * Key headers, such as 'ssh-rsa' --- put these in the `type` attribute.
29
+ * Key identifiers / comments, such as 'joescomputer.local' --- put these in
30
30
  the `name` attribute/resource title."
31
31
  end
32
32
 
@@ -105,7 +105,7 @@ Puppet::Type.newtype(:tidy) do
105
105
  desc "Tidy files whose age is equal to or greater than
106
106
  the specified time. You can choose seconds, minutes,
107
107
  hours, days, or weeks by specifying the first letter of any
108
- of those words (e.g., '1w').
108
+ of those words (for example, '1w' represents one week).
109
109
 
110
110
  Specifying 0 will remove all files."
111
111
 
@@ -224,7 +224,14 @@ Puppet::Type.newtype(:tidy) do
224
224
  # Make a file resource to remove a given file.
225
225
  def mkfile(path)
226
226
  # Force deletion, so directories actually get deleted.
227
- Puppet::Type.type(:file).new :path => path, :backup => self[:backup], :ensure => :absent, :force => true
227
+ parameters = {
228
+ :path => path, :backup => self[:backup],
229
+ :ensure => :absent, :force => true
230
+ }
231
+
232
+ parameters[:noop] = self[:noop] unless self[:noop].nil?
233
+
234
+ Puppet::Type.type(:file).new(parameters)
228
235
  end
229
236
 
230
237
  def retrieve
@@ -411,7 +411,7 @@ module Puppet
411
411
  a zero-padded YYYY-MM-DD format -- for example, 2010-02-19."
412
412
 
413
413
  newvalues :absent
414
- newvalues /^\d{4}-\d{2}-\d{2}$/
414
+ newvalues(/^\d{4}-\d{2}-\d{2}$/)
415
415
 
416
416
  validate do |value|
417
417
  if value.intern != :absent and value !~ /^\d{4}-\d{2}-\d{2}$/
@@ -165,7 +165,8 @@ Puppet::Type.newtype(:yumrepo) do
165
165
  end
166
166
 
167
167
  newproperty(:exclude) do
168
- desc "List of shell globs. Matching packages will never be
168
+ desc "The string of package names or shell globs separated by spaces to exclude.
169
+ Packages that match the package name given or shell globs will never be
169
170
  considered in updates or installs for this repo.
170
171
  #{ABSENT_DOC}"
171
172
 
@@ -187,9 +188,10 @@ Puppet::Type.newtype(:yumrepo) do
187
188
  end
188
189
 
189
190
  newproperty(:includepkgs) do
190
- desc "List of shell globs. If this is set, only packages
191
- matching one of the globs will be considered for
192
- update or install from this repository. #{ABSENT_DOC}"
191
+ desc "The string of package names or shell globs separated by spaces to
192
+ include. If this is set, only packages matching one of the package
193
+ names or shell globs will be considered for update or install
194
+ from this repository. #{ABSENT_DOC}"
193
195
 
194
196
  newvalues(/.*/, :absent)
195
197
  end
@@ -415,4 +417,23 @@ Puppet::Type.newtype(:yumrepo) do
415
417
 
416
418
  newvalues(/^\d+$/, :absent)
417
419
  end
420
+
421
+ newproperty(:username) do
422
+ desc "Username to use for basic authentication to a repo or really any url.
423
+ #{ABSENT_DOC}"
424
+ newvalues(/.*/, :absent)
425
+ end
426
+
427
+ newproperty(:password) do
428
+ desc "Password to use with the username for basic authentication.
429
+ #{ABSENT_DOC}"
430
+ newvalues(/.*/, :absent)
431
+ end
432
+
433
+ private
434
+
435
+ def set_sensitive_parameters(sensitive_parameters)
436
+ parameter(:password).sensitive = true if parameter(:password)
437
+ super(sensitive_parameters)
438
+ end
418
439
  end
@@ -20,6 +20,10 @@ parent zfs instances, the zfs resource will autorequire them."
20
20
  desc "The aclmode property. Valid values are `discard`, `groupmask`, `passthrough`."
21
21
  end
22
22
 
23
+ newproperty(:acltype) do
24
+ desc "The acltype propery. Valid values are 'noacl' and 'posixacl'. Only supported on Linux."
25
+ end
26
+
23
27
  newproperty(:atime) do
24
28
  desc "The atime property. Valid values are `on`, `off`."
25
29
  end
@@ -366,12 +366,8 @@ module Util
366
366
  end
367
367
  module_function :uri_to_path
368
368
 
369
- private
370
-
371
369
  RFC_3986_URI_REGEX = /^(?<scheme>([^:\/?#]+):)?(?<authority>\/\/([^\/?#]*))?(?<path>[^?#]*)(\?(?<query>[^#]*))?(#(?<fragment>.*))?$/
372
370
 
373
- public
374
-
375
371
  # Percent-encodes a URI query parameter per RFC3986 - https://tools.ietf.org/html/rfc3986
376
372
  #
377
373
  # The output will correctly round-trip through URI.unescape
@@ -82,5 +82,5 @@ module Puppet::Util::Backups
82
82
  sum = self.bucket.backup(f)
83
83
  self.info _("Filebucketed %{f} to %{filebucket} with sum %{sum}") % { f: f, filebucket: self.bucket.name, sum: sum }
84
84
  return sum
85
- end
85
+ end
86
86
  end
@@ -157,8 +157,10 @@ module Puppet::Util::HttpProxy
157
157
  proxy
158
158
  end
159
159
 
160
- # Retrieve a document through HTTP(s), following redirects if necessary.
161
- #
160
+ # Retrieve a document through HTTP(s), following redirects if necessary. The
161
+ # returned response body may be compressed, and it is the caller's
162
+ # responsibility to decompress it based on the 'content-encoding' header.
163
+ #
162
164
  # Based on the the client implementation in the HTTP pool.
163
165
  #
164
166
  # @see Puppet::Network::HTTP::Connection#request_with_redirects
@@ -148,7 +148,7 @@ module Puppet::Util::IniConfig
148
148
  )
149
149
  INI_CONTINUATION = /^[ \t\r\n\f]/
150
150
  INI_SECTION_NAME = /^\[([^\]]+)\]/
151
- INI_PROPERTY = /^\s*([^\s=]+)\s*\=(.*)$/
151
+ INI_PROPERTY = /^\s*([^\s=]+)\s*\=\s*(.*)$/
152
152
 
153
153
  # @api private
154
154
  def parse(text)
@@ -177,10 +177,9 @@ module Puppet::Util::IniConfig
177
177
  section = add_section(section_name)
178
178
  optname = nil
179
179
  elsif (match = l.match(INI_PROPERTY))
180
- # We allow space around the keys, but not the values
181
- # For the values, we don't know if space is significant
180
+ # the regex strips leading white space from the value, and here we strip the trailing white space as well
182
181
  key = match[1]
183
- val = match[2]
182
+ val = match[2].rstrip
184
183
 
185
184
  if section.nil?
186
185
  raise IniParseError.new(_("Property with key %{key} outside of a section") % { key: key.inspect })
@@ -164,8 +164,6 @@ class Puppet::Util::Log
164
164
  end
165
165
  end
166
166
 
167
- private
168
- # produces UTF-8 strings or dumps strings when they cannot be re-encoded
169
167
  def Log.coerce_string(str)
170
168
  return Puppet::Util::CharacterEncoding.convert_to_utf_8(str) if str.valid_encoding?
171
169
 
@@ -175,8 +173,7 @@ class Puppet::Util::Log
175
173
  message += '\n' + _("Backtrace:\n%{backtrace}") % { backtrace: caller[0..10].join("\n") }
176
174
  message
177
175
  end
178
-
179
- public
176
+ private_class_method :coerce_string
180
177
 
181
178
  # Route the actual message. FIXME There are lots of things this method
182
179
  # should do, like caching and a bit more. It's worth noting that there's
@@ -381,7 +378,7 @@ class Puppet::Util::Log
381
378
  def source=(source)
382
379
  if defined?(Puppet::Type) && source.is_a?(Puppet::Type)
383
380
  @source = source.path
384
- source.tags.each { |t| tag(t) }
381
+ merge_tags_from(source)
385
382
  self.file = source.file
386
383
  self.line = source.line
387
384
  else
@@ -63,7 +63,7 @@ class Puppet::Util::NetworkDevice::Cisco::Facts
63
63
  end
64
64
 
65
65
  def uptime_to_seconds(uptime)
66
- captures = (uptime.match /^(?:(\d+) years?,)?\s*(?:(\d+) weeks?,)?\s*(?:(\d+) days?,)?\s*(?:(\d+) hours?,)?\s*(\d+) minutes?$/).captures
66
+ captures = (uptime.match(/^(?:(\d+) years?,)?\s*(?:(\d+) weeks?,)?\s*(?:(\d+) days?,)?\s*(?:(\d+) hours?,)?\s*(\d+) minutes?$/)).captures
67
67
  captures.zip([31536000, 604800, 86400, 3600, 60]).inject(0) do |total, (x,y)|
68
68
  total + (x.nil? ? 0 : x.to_i * y)
69
69
  end
@@ -12,10 +12,6 @@ class Puppet::Util::Reference
12
12
 
13
13
  instance_load(:reference, 'puppet/reference')
14
14
 
15
- def self.footer
16
- "\n\n----------------\n\n" + _("*This page autogenerated on %{current_time}*\n") % { current_time: Time.now.to_s }
17
- end
18
-
19
15
  def self.modes
20
16
  %w{pdf text}
21
17
  end
@@ -111,15 +107,12 @@ class Puppet::Util::Reference
111
107
  def to_markdown(withcontents = true)
112
108
  # First the header
113
109
  text = markdown_header(@title, 1)
114
- #TRANSLATORS message accompanied by date of generation
115
- text << _("\n\n**This page is autogenerated; any changes will get overwritten** *(last generated on %{current_time})*\n\n") % { current_time: Time.now.to_s }
110
+ text << _("\n\n**This page is autogenerated; any changes will get overwritten**\n\n")
116
111
 
117
112
  text << @header
118
113
 
119
114
  text << generate
120
115
 
121
- text << self.class.footer if withcontents
122
-
123
116
  text
124
117
  end
125
118
  end
@@ -87,7 +87,7 @@ module Puppet::Util::Tagging
87
87
 
88
88
  # Merge tags from a tagged instance with no attempts to split, downcase
89
89
  # or verify the tags
90
- def merge_tags(tag_source)
90
+ def merge_tags_from(tag_source)
91
91
  @tags ||= new_tags
92
92
  tag_source.merge_into(@tags)
93
93
  end
@@ -20,8 +20,6 @@ module Puppet::Util::Warnings
20
20
  nil
21
21
  end
22
22
 
23
- protected
24
-
25
23
  def self.maybe_log(message, klass)
26
24
  @stampwarnings ||= {}
27
25
  @stampwarnings[klass] ||= []
@@ -66,7 +66,7 @@ module Puppet::Util::Windows::ADSI
66
66
  return sid_uri(sid) if sid.kind_of?(Puppet::Util::Windows::SID::Principal)
67
67
 
68
68
  begin
69
- sid = Puppet::Util::Windows::SID.name_to_sid_object(sid)
69
+ sid = Puppet::Util::Windows::SID.name_to_principal(sid)
70
70
  sid_uri(sid)
71
71
  rescue Puppet::Util::Windows::Error, Puppet::Error
72
72
  nil
@@ -114,7 +114,7 @@ module Puppet::Util::Windows::ADSI
114
114
  Puppet::Util::Windows::SID.sid_to_name('S-1-5-32').upcase,
115
115
  # localized version of NT AUTHORITY (can't use S-1-5)
116
116
  # for instance AUTORITE NT on French Windows
117
- Puppet::Util::Windows::SID.name_to_sid_object('SYSTEM').domain.upcase
117
+ Puppet::Util::Windows::SID.name_to_principal('SYSTEM').domain.upcase
118
118
  ]
119
119
  end
120
120
 
@@ -139,10 +139,12 @@ module Puppet::Util::Windows::ADSI
139
139
  return account, domain
140
140
  end
141
141
 
142
+ # returns Puppet::Util::Windows::SID::Principal[]
143
+ # may contain objects that represent unresolvable SIDs
142
144
  def get_sids(adsi_child_collection)
143
145
  sids = []
144
146
  adsi_child_collection.each do |m|
145
- sids << Puppet::Util::Windows::SID.octet_string_to_sid_object(m.objectSID)
147
+ sids << Puppet::Util::Windows::SID.ads_to_principal(m)
146
148
  end
147
149
 
148
150
  sids
@@ -152,7 +154,7 @@ module Puppet::Util::Windows::ADSI
152
154
  return {} if names.nil? || names.empty?
153
155
 
154
156
  sids = names.map do |name|
155
- sid = Puppet::Util::Windows::SID.name_to_sid_object(name)
157
+ sid = Puppet::Util::Windows::SID.name_to_principal(name)
156
158
  raise Puppet::Error.new( _("Could not resolve name: %{name}") % { name: name } ) if !sid
157
159
  [sid.sid, sid]
158
160
  end
@@ -183,7 +185,7 @@ module Puppet::Util::Windows::ADSI
183
185
  end
184
186
 
185
187
  def sid
186
- @sid ||= Puppet::Util::Windows::SID.octet_string_to_sid_object(native_user.objectSID)
188
+ @sid ||= Puppet::Util::Windows::SID.octet_string_to_principal(native_user.objectSID)
187
189
  end
188
190
 
189
191
  def uri
@@ -336,12 +338,12 @@ module Puppet::Util::Windows::ADSI
336
338
  end
337
339
 
338
340
  def self.current_user_sid
339
- Puppet::Util::Windows::SID.name_to_sid_object(current_user_name)
341
+ Puppet::Util::Windows::SID.name_to_principal(current_user_name)
340
342
  end
341
343
 
342
344
  def self.exists?(name_or_sid)
343
345
  well_known = false
344
- if (sid = Puppet::Util::Windows::SID.name_to_sid_object(name_or_sid))
346
+ if (sid = Puppet::Util::Windows::SID.name_to_principal(name_or_sid))
345
347
  return true if sid.account_type == :SidTypeUser
346
348
 
347
349
  # 'well known group' is special as it can be a group like Everyone OR a user like SYSTEM
@@ -431,7 +433,7 @@ module Puppet::Util::Windows::ADSI
431
433
  end
432
434
 
433
435
  def sid
434
- @sid ||= Puppet::Util::Windows::SID.octet_string_to_sid_object(native_group.objectSID)
436
+ @sid ||= Puppet::Util::Windows::SID.octet_string_to_principal(native_group.objectSID)
435
437
  end
436
438
 
437
439
  def commit
@@ -463,18 +465,13 @@ module Puppet::Util::Windows::ADSI
463
465
  end
464
466
  end
465
467
 
468
+ # returns Puppet::Util::Windows::SID::Principal[]
469
+ # may contain objects that represent unresolvable SIDs
470
+ # qualified account names are returned by calling #domain_account
466
471
  def members
467
- # WIN32OLE objects aren't enumerable, so no map
468
- members = []
469
- # Setting WIN32OLE.codepage in the microsoft_windows feature ensures
470
- # values are returned as UTF-8
471
- native_group.Members.each {|m| members << m.Name}
472
- members
473
- end
474
-
475
- def member_sids
476
472
  self.class.get_sids(native_group.Members)
477
473
  end
474
+ alias member_sids members
478
475
 
479
476
  def set_members(desired_members, inclusive = true)
480
477
  return if desired_members.nil?
@@ -508,7 +505,7 @@ module Puppet::Util::Windows::ADSI
508
505
 
509
506
  def self.exists?(name_or_sid)
510
507
  well_known = false
511
- if (sid = Puppet::Util::Windows::SID.name_to_sid_object(name_or_sid))
508
+ if (sid = Puppet::Util::Windows::SID.name_to_principal(name_or_sid))
512
509
  return true if sid.account_type == :SidTypeGroup
513
510
 
514
511
  # 'well known group' is special as it can be a group like Everyone OR a user like SYSTEM