bolt 0.5.1 → 0.6.0

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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/exe/bolt +1 -1
  3. data/lib/bolt.rb +0 -3
  4. data/lib/bolt/cli.rb +66 -32
  5. data/lib/bolt/config.rb +19 -0
  6. data/lib/bolt/executor.rb +21 -16
  7. data/lib/bolt/node.rb +13 -10
  8. data/lib/bolt/node/errors.rb +22 -0
  9. data/lib/bolt/node/ssh.rb +25 -2
  10. data/lib/bolt/node/winrm.rb +14 -2
  11. data/lib/bolt/node_uri.rb +15 -14
  12. data/lib/bolt/result.rb +22 -0
  13. data/lib/bolt/version.rb +1 -1
  14. data/vendored/puppet/lib/puppet/application/script.rb +7 -1
  15. data/vendored/puppet/lib/puppet/configurer.rb +1 -1
  16. data/vendored/puppet/lib/puppet/defaults.rb +18 -1
  17. data/vendored/puppet/lib/puppet/functions/run_command.rb +5 -2
  18. data/vendored/puppet/lib/puppet/functions/run_script.rb +5 -2
  19. data/vendored/puppet/lib/puppet/functions/run_task.rb +7 -2
  20. data/vendored/puppet/lib/puppet/gettext/config.rb +47 -26
  21. data/vendored/puppet/lib/puppet/graph/relationship_graph.rb +6 -0
  22. data/vendored/puppet/lib/puppet/indirector/node/ldap.rb +19 -3
  23. data/vendored/puppet/lib/puppet/module.rb +8 -7
  24. data/vendored/puppet/lib/puppet/network/http/webrick.rb +1 -0
  25. data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +9 -0
  26. data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +8 -0
  27. data/vendored/puppet/lib/puppet/pops/types/p_error_type.rb +12 -0
  28. data/vendored/puppet/lib/puppet/pops/types/p_object_type.rb +9 -3
  29. data/vendored/puppet/lib/puppet/pops/types/ruby_generator.rb +65 -24
  30. data/vendored/puppet/lib/puppet/provider/mount.rb +25 -8
  31. data/vendored/puppet/lib/puppet/provider/package/dnf.rb +1 -1
  32. data/vendored/puppet/lib/puppet/provider/package/gem.rb +1 -1
  33. data/vendored/puppet/lib/puppet/provider/package/pkg.rb +3 -0
  34. data/vendored/puppet/lib/puppet/provider/service/launchd.rb +1 -1
  35. data/vendored/puppet/lib/puppet/provider/zfs/zfs.rb +20 -1
  36. data/vendored/puppet/lib/puppet/type/mount.rb +6 -2
  37. data/vendored/puppet/lib/puppet/type/yumrepo.rb +9 -0
  38. data/vendored/puppet/lib/puppet/version.rb +1 -1
  39. data/vendored/puppet/lib/puppet_pal.rb +33 -7
  40. metadata +45 -83
  41. data/.gitignore +0 -33
  42. data/.gitmodules +0 -12
  43. data/.rspec +0 -2
  44. data/.rubocop.yml +0 -61
  45. data/.travis.yml +0 -18
  46. data/CODE_OF_CONDUCT.md +0 -46
  47. data/CONTRIBUTING.md +0 -27
  48. data/Gemfile +0 -9
  49. data/INSTALL.md +0 -70
  50. data/LICENSE +0 -201
  51. data/README.md +0 -353
  52. data/Rakefile +0 -27
  53. data/Vagrantfile +0 -13
  54. data/appveyor.yml +0 -29
  55. data/bolt.gemspec +0 -50
  56. data/docs/writing_tasks_and_plans.pdf +0 -0
  57. data/metadata.json +0 -13
  58. data/tasks/init.json +0 -3
  59. data/tasks/init.rb +0 -44
  60. data/ux/bolt-CLI-spec.md +0 -186
  61. data/vendored/puppet/lib/puppet/external/nagios/grammar.ry +0 -248
  62. data/vendored/puppet/lib/puppet/external/nagios/makefile +0 -9
  63. data/vendored/puppet/lib/puppet/face/help/action.erb +0 -86
  64. data/vendored/puppet/lib/puppet/face/help/face.erb +0 -114
  65. data/vendored/puppet/lib/puppet/face/help/global.erb +0 -16
  66. data/vendored/puppet/lib/puppet/face/help/man.erb +0 -152
  67. data/vendored/puppet/lib/puppet/generate/templates/type/pcore.erb +0 -42
  68. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/.fixtures.yml.erb +0 -7
  69. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/.gitignore +0 -18
  70. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/.rubocop.yml +0 -42
  71. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/.yardopts +0 -1
  72. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/Gemfile +0 -18
  73. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +0 -89
  74. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +0 -32
  75. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/examples/init.pp.erb +0 -12
  76. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +0 -48
  77. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +0 -1
  78. data/vendored/puppet/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +0 -6
  79. data/vendored/puppet/lib/puppet/pops/model/ast.pp +0 -695
  80. data/vendored/puppet/lib/puppet/pops/parser/egrammar.ra +0 -937
  81. data/vendored/puppet/lib/puppet/pops/resource/resource_type_set.pcore +0 -22
  82. data/vendored/puppet/lib/puppet/util/libuser.conf +0 -15
  83. data/vendored/puppet/lib/puppet/vendor/deep_merge/CHANGELOG +0 -45
  84. data/vendored/puppet/lib/puppet/vendor/deep_merge/Gemfile +0 -3
  85. data/vendored/puppet/lib/puppet/vendor/deep_merge/LICENSE +0 -21
  86. data/vendored/puppet/lib/puppet/vendor/deep_merge/PUPPET_README.md +0 -6
  87. data/vendored/puppet/lib/puppet/vendor/deep_merge/README.md +0 -113
  88. data/vendored/puppet/lib/puppet/vendor/deep_merge/Rakefile +0 -19
  89. data/vendored/puppet/lib/puppet/vendor/deep_merge/deep_merge.gemspec +0 -35
  90. data/vendored/puppet/lib/puppet/vendor/pathspec/CHANGELOG.md +0 -2
  91. data/vendored/puppet/lib/puppet/vendor/pathspec/LICENSE +0 -201
  92. data/vendored/puppet/lib/puppet/vendor/pathspec/PUPPET_README.md +0 -6
  93. data/vendored/puppet/lib/puppet/vendor/pathspec/README.md +0 -53
  94. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/locales/config.yaml +0 -21
@@ -54,6 +54,7 @@ class Puppet::Network::HTTP::WEBrick
54
54
 
55
55
  # @api private
56
56
  def create_server(address, port)
57
+ address = nil if address == '*'
57
58
  arguments = {:BindAddress => address, :Port => port, :DoNotReverseLookup => true}
58
59
  arguments.merge!(setup_logger)
59
60
  arguments.merge!(setup_ssl)
@@ -93,6 +93,10 @@ module LoaderPaths
93
93
  TypedName.new(type, n, name_authority)
94
94
  end
95
95
 
96
+ def valid_name?(typed_name)
97
+ true
98
+ end
99
+
96
100
  def relative_path
97
101
  raise NotImplementedError.new
98
102
  end
@@ -221,6 +225,11 @@ module LoaderPaths
221
225
  require_relative 'task_instantiator'
222
226
  TaskInstantiator
223
227
  end
228
+
229
+ def valid_name?(typed_name)
230
+ # TODO: Remove when PE has proper namespace handling
231
+ typed_name.name_parts.size <= 2
232
+ end
224
233
  end
225
234
 
226
235
  class ResourceTypeImplPP < PuppetSmartPath
@@ -113,6 +113,7 @@ module ModuleLoaders
113
113
  smart_paths.effective_paths(type).each do |sp|
114
114
  relative_paths(sp).each do |rp|
115
115
  tp = sp.typed_name(type, name_authority, rp, global ? nil : @module_name)
116
+ next unless sp.valid_name?(tp)
116
117
  load_typed(tp) unless block_given? && !block.yield(tp)
117
118
  end
118
119
  end
@@ -333,6 +334,7 @@ module ModuleLoaders
333
334
  def find_existing_path(typed_name)
334
335
  is_global = global?
335
336
  smart_paths.effective_paths(typed_name.type).each do |sp|
337
+ next unless sp.valid_name?(typed_name)
336
338
  origin = sp.effective_path(typed_name, is_global ? 0 : 1)
337
339
  unless origin.nil?
338
340
  if sp.match_many?
@@ -388,6 +390,12 @@ module ModuleLoaders
388
390
 
389
391
  def add_to_index(smart_path)
390
392
  found = Dir.glob(File.join(smart_path.generic_path, '**', "*#{smart_path.extension}"))
393
+
394
+ # The reason for not always rejecting directories here is performance (avoid extra stat calls). The
395
+ # false positives (directories with a matching extension) is an error in any case and will be caught
396
+ # later.
397
+ found = found.reject { |file_name| File.directory?(file_name) } if smart_path.extension.empty?
398
+
391
399
  @path_index.merge(found)
392
400
  found
393
401
  end
@@ -12,6 +12,10 @@ class PErrorType < PAnyType
12
12
  return PErrorType::DEFAULT
13
13
  end
14
14
 
15
+ def self.from_hash(hash)
16
+ self.new(hash['message'], hash['kind'], hash['issue_code'] || DEFAULT_ISSUE_CODE, hash['partial_result'], hash['details'])
17
+ end
18
+
15
19
  def initialize(message, kind = nil, issue_code = DEFAULT_ISSUE_CODE, partial_result = nil, details = nil)
16
20
  @issue_code = issue_code
17
21
  @kind = kind
@@ -63,6 +67,14 @@ class PErrorType < PAnyType
63
67
  optional_param 'Optional[DataHash]', :details
64
68
  end
65
69
 
70
+ dispatch :from_hash do
71
+ param 'Struct[message => String[1], Optional[kind] => String[1], Optional[issue_code] => String[1], Optional[partial_result] => Data, Optional[details] => DataHash]', :hash
72
+ end
73
+
74
+ def from_hash(hash)
75
+ Error.from_hash(hash)
76
+ end
77
+
66
78
  def create(message, kind = nil, issue_code = nil, partial_result = nil, details = nil)
67
79
  issue_code = DEFAULT_ISSUE_CODE if issue_code.nil?
68
80
  Error.new(message, kind, issue_code, partial_result, details)
@@ -228,10 +228,10 @@ class PObjectType < PMetaType
228
228
  # TODO: Assumes Ruby implementation for now
229
229
  if(callable_type.is_a?(PVariantType))
230
230
  callable_type.types.map do |ct|
231
- Functions::Dispatch.new(ct, name, [], false, ct.block_type.nil? ? nil : 'block')
231
+ Functions::Dispatch.new(ct, RubyGenerator.protect_reserved_name(name), [], false, ct.block_type.nil? ? nil : 'block')
232
232
  end
233
233
  else
234
- [Functions::Dispatch.new(callable_type, name, [], false, callable_type.block_type.nil? ? nil : 'block')]
234
+ [Functions::Dispatch.new(callable_type, RubyGenerator.protect_reserved_name(name), [], false, callable_type.block_type.nil? ? nil : 'block')]
235
235
  end
236
236
  end
237
237
 
@@ -546,7 +546,13 @@ class PObjectType < PMetaType
546
546
  init_non_opt_count = 0
547
547
  init_param_names = init.parameters.map do |p|
548
548
  init_non_opt_count += 1 if :req == p[0]
549
- p[1].to_s
549
+ n = p[1].to_s
550
+ r = RubyGenerator.unprotect_reserved_name(n)
551
+ unless r.equal?(n)
552
+ # assert that the protected name wasn't a real name (names can start with underscore)
553
+ n = r unless param_names.index(r).nil?
554
+ end
555
+ n
550
556
  end
551
557
 
552
558
  if init_param_names != param_names
@@ -3,6 +3,43 @@ module Types
3
3
 
4
4
  # @api private
5
5
  class RubyGenerator < TypeFormatter
6
+
7
+ RUBY_RESERVED_WORDS = {
8
+ 'alias' => '_alias',
9
+ 'begin' => '_begin',
10
+ 'break' => '_break',
11
+ 'def' => '_def',
12
+ 'do' => '_do',
13
+ 'end' => '_end',
14
+ 'ensure' => '_ensure',
15
+ 'for' => '_for',
16
+ 'module' => '_module',
17
+ 'next' => '_next',
18
+ 'nil' => '_nil',
19
+ 'not' => '_not',
20
+ 'redo' => '_redo',
21
+ 'rescue' => '_rescue',
22
+ 'retry' => '_retry',
23
+ 'return' => '_return',
24
+ 'self' => '_self',
25
+ 'super' => '_super',
26
+ 'then' => '_then',
27
+ 'until' => '_until',
28
+ 'when' => '_when',
29
+ 'while' => '_while',
30
+ 'yield' => '_yield',
31
+ }
32
+
33
+ RUBY_RESERVED_WORDS_REVERSED = Hash[RUBY_RESERVED_WORDS.map { |k, v| [v, k] }]
34
+
35
+ def self.protect_reserved_name(name)
36
+ RUBY_RESERVED_WORDS[name] || name
37
+ end
38
+
39
+ def self.unprotect_reserved_name(name)
40
+ RUBY_RESERVED_WORDS_REVERSED[name] || name
41
+ end
42
+
6
43
  def remove_common_namespace(namespace_segments, name)
7
44
  segments = name.split(TypeFormatter::NAME_SEGMENT_SEPARATOR)
8
45
  namespace_segments.size.times do |idx|
@@ -174,8 +211,8 @@ class RubyGenerator < TypeFormatter
174
211
  constants, others = obj.attributes(true).values.partition { |a| a.kind == PObjectType::ATTRIBUTE_KIND_CONSTANT }
175
212
  constants = constants.select { |ca| ca.container.equal?(obj) }
176
213
  unless constants.empty?
177
- constants.each { |ca| bld << "\n def self." << ca.name << "\n _pcore_type['" << ca.name << "'].value\n end\n" }
178
- constants.each { |ca| bld << "\n def " << ca.name << "\n self.class." << ca.name << "\n end\n" }
214
+ constants.each { |ca| bld << "\n def self." << rname(ca.name) << "\n _pcore_type['" << ca.name << "'].value\n end\n" }
215
+ constants.each { |ca| bld << "\n def " << rname(ca.name) << "\n self.class." << ca.name << "\n end\n" }
179
216
  end
180
217
 
181
218
  init_params = others.reject { |a| a.kind == PObjectType::ATTRIBUTE_KIND_DERIVED }
@@ -216,9 +253,9 @@ class RubyGenerator < TypeFormatter
216
253
  bld << "\n new"
217
254
  else
218
255
  bld << '('
219
- non_opt.each { |ip| bld << ip.name << ', ' }
256
+ non_opt.each { |ip| bld << rname(ip.name) << ', ' }
220
257
  opt.each do |ip|
221
- bld << ip.name << ' = '
258
+ bld << rname(ip.name) << ' = '
222
259
  default_string(bld, ip)
223
260
  bld << ', '
224
261
  end
@@ -228,11 +265,11 @@ class RubyGenerator < TypeFormatter
228
265
  bld << " attrs = _pcore_type.attributes(true)\n"
229
266
  init_params.each do |a|
230
267
  bld << " ta.assert_instance_of('" << a.container.name << '[' << a.name << ']'
231
- bld << "', attrs['" << a.name << "'].type, " << a.name << ")\n"
268
+ bld << "', attrs['" << a.name << "'].type, " << rname(a.name) << ")\n"
232
269
  end
233
270
  bld << ' new('
234
- non_opt.each { |a| bld << a.name << ', ' }
235
- opt.each { |a| bld << a.name << ', ' }
271
+ non_opt.each { |a| bld << rname(a.name) << ', ' }
272
+ opt.each { |a| bld << rname(a.name) << ', ' }
236
273
  bld.chomp!(', ')
237
274
  bld << ')'
238
275
  end
@@ -242,13 +279,13 @@ class RubyGenerator < TypeFormatter
242
279
  # Output attr_readers
243
280
  unless obj_attrs.empty?
244
281
  bld << "\n"
245
- obj_attrs.each { |a| bld << ' attr_reader :' << a.name << "\n" }
282
+ obj_attrs.each { |a| bld << ' attr_reader :' << rname(a.name) << "\n" }
246
283
  end
247
284
 
248
285
  bld << " attr_reader :hash\n" if obj.parent.nil?
249
286
 
250
287
  derived_attrs.each do |a|
251
- bld << "\n def " << a.name << "\n"
288
+ bld << "\n def " << rname(a.name) << "\n"
252
289
  code_annotation = RubyMethod.annotate(a)
253
290
  ruby_body = code_annotation.nil? ? nil: code_annotation.body
254
291
  if ruby_body.nil?
@@ -265,9 +302,9 @@ class RubyGenerator < TypeFormatter
265
302
  # Output initializer
266
303
  bld << "\n def initialize"
267
304
  bld << '('
268
- non_opt.each { |ip| bld << ip.name << ', ' }
305
+ non_opt.each { |ip| bld << rname(ip.name) << ', ' }
269
306
  opt.each do |ip|
270
- bld << ip.name << ' = '
307
+ bld << rname(ip.name) << ' = '
271
308
  default_string(bld, ip)
272
309
  bld << ', '
273
310
  end
@@ -282,18 +319,18 @@ class RubyGenerator < TypeFormatter
282
319
  bld << "\n super("
283
320
  super_args = (non_opt + opt).select { |ip| !ip.container.equal?(obj) }
284
321
  unless super_args.empty?
285
- super_args.each { |ip| bld << ip.name << ', ' }
322
+ super_args.each { |ip| bld << rname(ip.name) << ', ' }
286
323
  bld.chomp!(', ')
287
324
  end
288
325
  bld << ")\n"
289
326
  bld << ' @hash = @hash ^ ' unless hash_participants.empty?
290
327
  end
291
328
  unless hash_participants.empty?
292
- hash_participants.each { |a| bld << a.name << '.hash ^ ' if a.container.equal?(obj) }
329
+ hash_participants.each { |a| bld << rname(a.name) << '.hash ^ ' if a.container.equal?(obj) }
293
330
  bld.chomp!(' ^ ')
294
331
  bld << "\n"
295
332
  end
296
- init_params.each { |a| bld << ' @' << a.name << ' = ' << a.name << "\n" if a.container.equal?(obj) }
333
+ init_params.each { |a| bld << ' @' << rname(a.name) << ' = ' << rname(a.name) << "\n" if a.container.equal?(obj) }
297
334
  bld << " end\n"
298
335
  end
299
336
  end
@@ -304,7 +341,7 @@ class RubyGenerator < TypeFormatter
304
341
  bld << (obj.parent.nil? ? '{}' : 'super')
305
342
  bld << "\n"
306
343
  obj_attrs.each do |a|
307
- bld << " result['" << a.name << "'] = @" << a.name
344
+ bld << " result['" << a.name << "'] = @" << rname(a.name)
308
345
  if a.value?
309
346
  bld << ' unless '
310
347
  equals_default_string(bld, a)
@@ -324,21 +361,21 @@ class RubyGenerator < TypeFormatter
324
361
  bld << "\n def _pcore_contents\n"
325
362
  content_participants.each do |cp|
326
363
  if array_type?(cp.type)
327
- bld << ' @' << cp.name << ".each { |value| yield(value) }\n"
364
+ bld << ' @' << rname(cp.name) << ".each { |value| yield(value) }\n"
328
365
  else
329
- bld << ' yield(@' << cp.name << ') unless @' << cp.name << ".nil?\n"
366
+ bld << ' yield(@' << rname(cp.name) << ') unless @' << rname(cp.name) << ".nil?\n"
330
367
  end
331
368
  end
332
369
  bld << " end\n\n def _pcore_all_contents(path, &block)\n path << self\n"
333
370
  content_participants.each do |cp|
334
371
  if array_type?(cp.type)
335
- bld << ' @' << cp.name << ".each do |value|\n"
372
+ bld << ' @' << rname(cp.name) << ".each do |value|\n"
336
373
  bld << " block.call(value, path)\n"
337
374
  bld << " value._pcore_all_contents(path, &block)\n"
338
375
  else
339
- bld << ' unless @' << cp.name << ".nil?\n"
340
- bld << ' block.call(@' << cp.name << ", path)\n"
341
- bld << ' @' << cp.name << "._pcore_all_contents(path, &block)\n"
376
+ bld << ' unless @' << rname(cp.name) << ".nil?\n"
377
+ bld << ' block.call(@' << rname(cp.name) << ", path)\n"
378
+ bld << ' @' << rname(cp.name) << "._pcore_all_contents(path, &block)\n"
342
379
  end
343
380
  bld << " end\n"
344
381
  end
@@ -351,13 +388,13 @@ class RubyGenerator < TypeFormatter
351
388
  if code_annotation
352
389
  body = code_annotation.body
353
390
  params = code_annotation.parameters
354
- bld << "\n def " << func.name
391
+ bld << "\n def " << rname(func.name)
355
392
  unless params.nil? || params.empty?
356
393
  bld << '(' << params << ')'
357
394
  end
358
395
  bld << "\n " << body << "\n"
359
396
  else
360
- bld << "\n def " << func.name << "(*args)\n"
397
+ bld << "\n def " << rname(func.name) << "(*args)\n"
361
398
  bld << " # Placeholder for #{func.type}\n"
362
399
  bld << " raise Puppet::Error, \"no method is implemented for #{func.label}\"\n"
363
400
  end
@@ -368,7 +405,7 @@ class RubyGenerator < TypeFormatter
368
405
  bld << "\n def eql?(o)\n"
369
406
  bld << " super &&\n" unless obj.parent.nil?
370
407
  bld << " o.instance_of?(self.class) &&\n" if include_type
371
- eq_names.each { |eqn| bld << ' @' << eqn << '.eql?(o.' << eqn << ") &&\n" }
408
+ eq_names.each { |eqn| bld << ' @' << rname(eqn) << '.eql?(o.' << rname(eqn) << ") &&\n" }
372
409
  bld.chomp!(" &&\n")
373
410
  bld << "\n end\n alias == eql?\n"
374
411
  end
@@ -427,6 +464,10 @@ class RubyGenerator < TypeFormatter
427
464
  bld << "_pcore_type['" << a.name << "'].default_value?(@" << a.name << ')'
428
465
  end
429
466
  end
467
+
468
+ def rname(name)
469
+ RUBY_RESERVED_WORDS[name] || name
470
+ end
430
471
  end
431
472
  end
432
473
  end
@@ -26,21 +26,38 @@ module Puppet::Provider::Mount
26
26
  def remount
27
27
  #TRANSLATORS refers to remounting a file system
28
28
  info _("Remounting")
29
- if resource[:remounts] == :true
29
+ os = Facter.value(:operatingsystem)
30
+ supports_remounts = (resource[:remounts] == :true)
31
+ if supports_remounts && os == 'AIX'
32
+ remount_with_option("remount")
33
+ elsif os.match(/^(FreeBSD|DragonFly|OpenBSD)$/)
34
+ remount_with_option("update")
35
+ elsif supports_remounts
30
36
  mountcmd "-o", "remount", resource[:name]
31
- elsif ["FreeBSD", "DragonFly", "OpenBSD"].include?(Facter.value(:operatingsystem))
32
- if self.options && !self.options.empty?
33
- options = self.options + ",update"
34
- else
35
- options = "update"
36
- end
37
- mountcmd "-o", options, resource[:name]
38
37
  else
39
38
  unmount
40
39
  mount
41
40
  end
42
41
  end
43
42
 
43
+ # Remount by appending the supplied param "option" to any existing explicitly
44
+ # defined options. If resource has no explicitly defined options, will mount
45
+ # with only "option".
46
+ # @param [String] option A remount option to use or append with existing options
47
+ #
48
+ def remount_with_option(option)
49
+ if using_explicit_options?
50
+ options = self.options + "," + option
51
+ else
52
+ options = option
53
+ end
54
+ mountcmd "-o", options, resource[:name]
55
+ end
56
+
57
+ def using_explicit_options?
58
+ !self.options.nil? && !self.options.empty?
59
+ end
60
+
44
61
  # This only works when the mount point is synced to the fstab.
45
62
  def unmount
46
63
  umount(resource[:name])
@@ -28,7 +28,7 @@ Puppet::Type.type(:package).provide :dnf, :parent => :yum do
28
28
  end
29
29
  end
30
30
 
31
- defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => ['22', '23', '24', '25']
31
+ defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => ['22', '23', '24', '25', '26']
32
32
 
33
33
  def self.update_command
34
34
  # In DNF, update is deprecated for upgrade
@@ -31,7 +31,7 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d
31
31
  gem_list_command << "--source" << options[:source]
32
32
  end
33
33
  if name = options[:justme]
34
- gem_list_command << "^" + name + "$"
34
+ gem_list_command << '\A' + name + '\z'
35
35
  end
36
36
 
37
37
  begin
@@ -171,6 +171,9 @@ Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package d
171
171
  # http://defect.opensolaris.org/bz/show_bug.cgi?id=19159%
172
172
  # notes that we can't use -Ha for the same even though the manual page reads that way.
173
173
  def latest
174
+ # Refresh package metadata before looking for latest versions
175
+ pkg(:refresh)
176
+
174
177
  lines = pkg(:list, "-Hvn", @resource[:name]).split("\n")
175
178
 
176
179
  # remove certificate expiration warnings from the output, but report them
@@ -141,7 +141,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
141
141
  if job.has_key?("Label")
142
142
  @label_to_path_map[job["Label"]] = filepath
143
143
  else
144
- Puppet.warning("The #{filepath} plist does not contain a 'label' key; " +
144
+ Puppet.debug("The #{filepath} plist does not contain a 'label' key; " +
145
145
  "Puppet is skipping it")
146
146
  next
147
147
  end
@@ -38,6 +38,16 @@ Puppet::Type.type(:zfs).provide(:zfs) do
38
38
  end
39
39
  end
40
40
 
41
+ # On FreeBSD zoned is called jailed
42
+ def container_property
43
+ case Facter.value(:operatingsystem)
44
+ when "FreeBSD"
45
+ :jailed
46
+ else
47
+ :zoned
48
+ end
49
+ end
50
+
41
51
  PARAMETER_UNSET_OR_NOT_AVAILABLE = '-'
42
52
 
43
53
  # https://docs.oracle.com/cd/E19963-01/html/821-1448/gbscy.html
@@ -70,7 +80,7 @@ Puppet::Type.type(:zfs).provide(:zfs) do
70
80
  :mountpoint, :nbmand, :primarycache, :quota, :readonly,
71
81
  :recordsize, :refquota, :refreservation, :reservation,
72
82
  :secondarycache, :setuid, :sharenfs, :sharesmb,
73
- :snapdir, :version, :volsize, :vscan, :xattr, :zoned].each do |field|
83
+ :snapdir, :version, :volsize, :vscan, :xattr].each do |field|
74
84
  define_method(field) do
75
85
  zfs(:get, "-H", "-o", "value", field, @resource[:name]).strip
76
86
  end
@@ -80,5 +90,14 @@ Puppet::Type.type(:zfs).provide(:zfs) do
80
90
  end
81
91
  end
82
92
 
93
+
94
+ define_method(:zoned) do
95
+ zfs(:get, "-H", "-o", "value", container_property, @resource[:name]).strip
96
+ end
97
+
98
+ define_method("zoned=") do |should|
99
+ zfs(:set, "#{container_property}=#{should}", @resource[:name])
100
+ end
101
+
83
102
  end
84
103
 
@@ -173,8 +173,12 @@ module Puppet
173
173
 
174
174
  newproperty(:options) do
175
175
  desc "A single string containing options for the mount, as they would
176
- appear in fstab. For many platforms this is a comma delimited string.
177
- Consult the fstab(5) man page for system-specific details."
176
+ appear in fstab on Linux. For many platforms this is a comma-delimited
177
+ string. Consult the fstab(5) man page for system-specific details.
178
+ AIX options other than dev, nodename, or vfs can be defined here. If
179
+ specified, AIX options of account, boot, check, free, mount, size,
180
+ type, vol, log, and quota must be ordered alphabetically at the end of
181
+ the list."
178
182
 
179
183
  validate do |value|
180
184
  raise Puppet::Error, _("options must not contain whitespace: %{value}") % { value: value } if value =~ /\s/