puppet 7.9.0-universal-darwin → 7.10.0-universal-darwin

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 (182) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -6
  3. data/{ext → examples/enc}/regexp_nodes/classes/databases +0 -0
  4. data/{ext → examples/enc}/regexp_nodes/classes/webservers +0 -0
  5. data/{ext → examples/enc}/regexp_nodes/environment/development +0 -0
  6. data/{ext → examples/enc}/regexp_nodes/parameters/service/prod +0 -0
  7. data/{ext → examples/enc}/regexp_nodes/parameters/service/qa +0 -0
  8. data/{ext → examples/enc}/regexp_nodes/parameters/service/sandbox +0 -0
  9. data/{ext → examples/enc}/regexp_nodes/regexp_nodes.rb +0 -0
  10. data/{ext → examples}/nagios/check_puppet.rb +2 -2
  11. data/ext/README.md +13 -0
  12. data/lib/puppet/configurer.rb +155 -46
  13. data/lib/puppet/defaults.rb +51 -26
  14. data/lib/puppet/environments.rb +66 -26
  15. data/lib/puppet/file_serving/configuration.rb +2 -0
  16. data/lib/puppet/file_serving/configuration/parser.rb +2 -0
  17. data/lib/puppet/file_serving/mount/scripts.rb +24 -0
  18. data/lib/puppet/functions/find_template.rb +2 -2
  19. data/lib/puppet/http/service/compiler.rb +6 -1
  20. data/lib/puppet/indirector/catalog/compiler.rb +21 -3
  21. data/lib/puppet/indirector/catalog/rest.rb +1 -0
  22. data/lib/puppet/indirector/terminus.rb +4 -0
  23. data/lib/puppet/module/plan.rb +0 -1
  24. data/lib/puppet/module/task.rb +1 -1
  25. data/lib/puppet/module_tool/applications/installer.rb +8 -4
  26. data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
  27. data/lib/puppet/node/environment.rb +10 -11
  28. data/lib/puppet/pops/serialization/to_data_converter.rb +18 -6
  29. data/lib/puppet/provider/package/pkg.rb +8 -1
  30. data/lib/puppet/provider/service/launchd.rb +1 -1
  31. data/lib/puppet/provider/service/systemd.rb +1 -1
  32. data/lib/puppet/provider/user/useradd.rb +42 -9
  33. data/lib/puppet/transaction/persistence.rb +11 -1
  34. data/lib/puppet/transaction/report.rb +15 -1
  35. data/lib/puppet/type.rb +1 -1
  36. data/lib/puppet/type/exec.rb +10 -1
  37. data/lib/puppet/type/file.rb +6 -6
  38. data/lib/puppet/type/filebucket.rb +2 -2
  39. data/lib/puppet/version.rb +1 -1
  40. data/locales/puppet.pot +134 -94
  41. data/man/man5/puppet.conf.5 +65 -25
  42. data/man/man8/puppet-agent.8 +1 -1
  43. data/man/man8/puppet-apply.8 +1 -1
  44. data/man/man8/puppet-catalog.8 +1 -1
  45. data/man/man8/puppet-config.8 +1 -1
  46. data/man/man8/puppet-describe.8 +1 -1
  47. data/man/man8/puppet-device.8 +1 -1
  48. data/man/man8/puppet-doc.8 +1 -1
  49. data/man/man8/puppet-epp.8 +1 -1
  50. data/man/man8/puppet-facts.8 +1 -1
  51. data/man/man8/puppet-filebucket.8 +1 -1
  52. data/man/man8/puppet-generate.8 +1 -1
  53. data/man/man8/puppet-help.8 +1 -1
  54. data/man/man8/puppet-lookup.8 +1 -1
  55. data/man/man8/puppet-module.8 +3 -3
  56. data/man/man8/puppet-node.8 +1 -1
  57. data/man/man8/puppet-parser.8 +1 -1
  58. data/man/man8/puppet-plugin.8 +1 -1
  59. data/man/man8/puppet-report.8 +1 -1
  60. data/man/man8/puppet-resource.8 +1 -1
  61. data/man/man8/puppet-script.8 +1 -1
  62. data/man/man8/puppet-ssl.8 +1 -1
  63. data/man/man8/puppet.8 +2 -2
  64. data/spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb +3 -0
  65. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile +4 -0
  66. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile +3 -0
  67. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb +8 -0
  68. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml +25 -0
  69. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po +19 -0
  70. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot +20 -0
  71. data/spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json +8 -0
  72. data/spec/integration/application/agent_spec.rb +102 -52
  73. data/spec/integration/application/filebucket_spec.rb +5 -0
  74. data/spec/integration/configurer_spec.rb +17 -1
  75. data/spec/integration/l10n/compiler_spec.rb +37 -0
  76. data/spec/lib/puppet_spec/modules.rb +13 -2
  77. data/spec/lib/puppet_spec/puppetserver.rb +15 -0
  78. data/spec/shared_behaviours/documentation_on_faces.rb +0 -2
  79. data/spec/shared_contexts/l10n.rb +27 -0
  80. data/spec/spec_helper.rb +1 -10
  81. data/spec/unit/configurer_spec.rb +265 -54
  82. data/spec/unit/environments_spec.rb +150 -1
  83. data/spec/unit/file_serving/configuration/parser_spec.rb +23 -0
  84. data/spec/unit/file_serving/configuration_spec.rb +12 -4
  85. data/spec/unit/file_serving/mount/scripts_spec.rb +69 -0
  86. data/spec/unit/functions/logging_spec.rb +1 -0
  87. data/spec/unit/http/service/compiler_spec.rb +8 -0
  88. data/spec/unit/indirector/catalog/compiler_spec.rb +87 -0
  89. data/spec/unit/indirector/catalog/rest_spec.rb +8 -0
  90. data/spec/unit/interface/action_spec.rb +0 -9
  91. data/spec/unit/module_spec.rb +14 -0
  92. data/spec/unit/module_tool/applications/installer_spec.rb +39 -12
  93. data/spec/unit/pops/parser/parse_containers_spec.rb +0 -11
  94. data/spec/unit/pops/serialization/to_from_hr_spec.rb +58 -0
  95. data/spec/unit/provider/package/pkg_spec.rb +19 -5
  96. data/spec/unit/provider/service/launchd_spec.rb +11 -0
  97. data/spec/unit/provider/service/systemd_spec.rb +1 -1
  98. data/spec/unit/provider/user/useradd_spec.rb +3 -2
  99. metadata +34 -94
  100. data/ext/README.environment +0 -8
  101. data/ext/dbfix.sql +0 -132
  102. data/ext/debian/README.Debian +0 -8
  103. data/ext/debian/README.source +0 -2
  104. data/ext/debian/TODO.Debian +0 -1
  105. data/ext/debian/changelog.erb +0 -1122
  106. data/ext/debian/compat +0 -1
  107. data/ext/debian/control +0 -144
  108. data/ext/debian/copyright +0 -339
  109. data/ext/debian/docs +0 -1
  110. data/ext/debian/fileserver.conf +0 -41
  111. data/ext/debian/puppet-common.dirs +0 -13
  112. data/ext/debian/puppet-common.install +0 -3
  113. data/ext/debian/puppet-common.lintian-overrides +0 -5
  114. data/ext/debian/puppet-common.manpages +0 -28
  115. data/ext/debian/puppet-common.postinst +0 -35
  116. data/ext/debian/puppet-common.postrm +0 -33
  117. data/ext/debian/puppet-el.dirs +0 -1
  118. data/ext/debian/puppet-el.emacsen-install +0 -25
  119. data/ext/debian/puppet-el.emacsen-remove +0 -11
  120. data/ext/debian/puppet-el.emacsen-startup +0 -9
  121. data/ext/debian/puppet-el.install +0 -1
  122. data/ext/debian/puppet-testsuite.install +0 -2
  123. data/ext/debian/puppet-testsuite.lintian-overrides +0 -4
  124. data/ext/debian/puppet.lintian-overrides +0 -3
  125. data/ext/debian/puppet.logrotate +0 -20
  126. data/ext/debian/puppet.postinst +0 -20
  127. data/ext/debian/puppet.postrm +0 -20
  128. data/ext/debian/puppet.preinst +0 -20
  129. data/ext/debian/puppetmaster-common.install +0 -2
  130. data/ext/debian/puppetmaster-common.manpages +0 -2
  131. data/ext/debian/puppetmaster-common.postinst +0 -6
  132. data/ext/debian/puppetmaster-passenger.dirs +0 -4
  133. data/ext/debian/puppetmaster-passenger.postinst +0 -162
  134. data/ext/debian/puppetmaster-passenger.postrm +0 -61
  135. data/ext/debian/puppetmaster.README.debian +0 -17
  136. data/ext/debian/puppetmaster.default +0 -14
  137. data/ext/debian/puppetmaster.init +0 -137
  138. data/ext/debian/puppetmaster.lintian-overrides +0 -3
  139. data/ext/debian/puppetmaster.postinst +0 -20
  140. data/ext/debian/puppetmaster.postrm +0 -5
  141. data/ext/debian/puppetmaster.preinst +0 -22
  142. data/ext/debian/rules +0 -132
  143. data/ext/debian/source/format +0 -1
  144. data/ext/debian/source/options +0 -1
  145. data/ext/debian/vim-puppet.README.Debian +0 -13
  146. data/ext/debian/vim-puppet.dirs +0 -5
  147. data/ext/debian/vim-puppet.yaml +0 -7
  148. data/ext/debian/watch +0 -2
  149. data/ext/freebsd/puppetd +0 -26
  150. data/ext/freebsd/puppetmasterd +0 -26
  151. data/ext/gentoo/conf.d/puppet +0 -5
  152. data/ext/gentoo/conf.d/puppetmaster +0 -12
  153. data/ext/gentoo/init.d/puppet +0 -38
  154. data/ext/gentoo/init.d/puppetmaster +0 -51
  155. data/ext/gentoo/puppet/fileserver.conf +0 -41
  156. data/ext/ips/puppet-agent +0 -44
  157. data/ext/ips/puppet-master +0 -44
  158. data/ext/ips/puppet.p5m.erb +0 -12
  159. data/ext/ips/puppetagent.xml +0 -42
  160. data/ext/ips/puppetmaster.xml +0 -42
  161. data/ext/ips/rules +0 -19
  162. data/ext/ips/transforms +0 -34
  163. data/ext/ldap/puppet.schema +0 -24
  164. data/ext/logcheck/puppet +0 -23
  165. data/ext/osx/file_mapping.yaml +0 -28
  166. data/ext/osx/postflight.erb +0 -109
  167. data/ext/osx/preflight.erb +0 -52
  168. data/ext/osx/prototype.plist.erb +0 -38
  169. data/ext/redhat/fileserver.conf +0 -41
  170. data/ext/redhat/logrotate +0 -21
  171. data/ext/redhat/puppet.spec.erb +0 -841
  172. data/ext/redhat/server.init +0 -128
  173. data/ext/redhat/server.sysconfig +0 -13
  174. data/ext/solaris/pkginfo +0 -6
  175. data/ext/solaris/smf/puppetd.xml +0 -77
  176. data/ext/solaris/smf/puppetmasterd.xml +0 -77
  177. data/ext/solaris/smf/svc-puppetd +0 -71
  178. data/ext/solaris/smf/svc-puppetmasterd +0 -67
  179. data/ext/suse/puppet.spec +0 -310
  180. data/ext/suse/server.init +0 -173
  181. data/ext/yaml_nodes.rb +0 -105
  182. data/spec/unit/indirector/store_configs_spec.rb +0 -7
@@ -33,6 +33,14 @@ describe Puppet::Resource::Catalog::Rest do
33
33
  described_class.indirection.find(certname, environment: Puppet::Node::Environment.remote('outerspace'))
34
34
  end
35
35
 
36
+ it "passes 'check_environment'" do
37
+ stub_request(:post, uri)
38
+ .with(body: hash_including('check_environment' => 'true'))
39
+ .to_return(**catalog_response(catalog))
40
+
41
+ described_class.indirection.find(certname, check_environment: true)
42
+ end
43
+
36
44
  it 'constructs a catalog environment_instance' do
37
45
  env = Puppet::Node::Environment.remote('outerspace')
38
46
  catalog = Puppet::Resource::Catalog.new(certname, env)
@@ -537,15 +537,6 @@ describe Puppet::Interface::Action do
537
537
  end
538
538
  end
539
539
 
540
- context "#when_rendering" do
541
- it "should fail if no type is given when_rendering"
542
- it "should accept a when_rendering block"
543
- it "should accept multiple when_rendering blocks"
544
- it "should fail if when_rendering gets a non-symbol identifier"
545
- it "should fail if a second block is given for the same type"
546
- it "should return the block if asked"
547
- end
548
-
549
540
  context "#validate_and_clean" do
550
541
  subject do
551
542
  Puppet::Interface.new(:validate_args, '1.0.0') do
@@ -567,6 +567,20 @@ describe Puppet::Module do
567
567
  expect(mod.task_file(task_exe)).to eq("#{mod.path}/tasks/#{task_exe}")
568
568
  end
569
569
 
570
+ it "should list files from the scripts directory if required by the task" do
571
+ mod = 'loads_scripts'
572
+ task_dep = 'myscript.sh'
573
+ script_ref = "#{mod}/scripts/#{task_dep}"
574
+ task_json = JSON.generate({'files' => [script_ref]})
575
+ task = [['task', { name: 'task.json', content: task_json }]]
576
+ mod = PuppetSpec::Modules.create(mod, @modpath, {:environment => env,
577
+ :scripts => [task_dep],
578
+ :tasks => task})
579
+
580
+ expect(mod.tasks.first.files).to include({'name' => script_ref,
581
+ 'path' => /#{script_ref}/})
582
+ end
583
+
570
584
  it "should return nil when asked for an individual task file if it does not exist" do
571
585
  mod = PuppetSpec::Modules.create('task_file_neg', @modpath, {:environment => env,
572
586
  :tasks => []})
@@ -284,18 +284,45 @@ describe Puppet::ModuleTool::Applications::Installer, :unless => RUBY_PLATFORM =
284
284
  expect(subject).to include :result => :failure
285
285
  end
286
286
 
287
- it 'prints a detailed error containing the modules that would not be satisfied' do
288
- graph = double(SemanticPuppet::Dependency::Graph, :modules => ['pmtacceptance-mysql'])
289
- exception = SemanticPuppet::Dependency::UnsatisfiableGraph.new(graph)
290
- allow(exception).to receive(:respond_to?).and_return(true)
291
- allow(exception).to receive(:unsatisfied).and_return('pmtacceptance-mysql')
292
- allow(SemanticPuppet::Dependency).to receive(:resolve).and_raise(exception)
293
-
294
- expect(subject[:error]).to include(:multiline)
295
- expect(subject[:error][:multiline]).to include("Could not install module 'pmtacceptance-mysql' (> 1.0.0)")
296
- expect(subject[:error][:multiline]).to include("The requested version cannot satisfy one or more of the following installed modules:")
297
- expect(subject[:error][:multiline]).to include("pmtacceptance-keystone, expects 'pmtacceptance-mysql': >=0.6.1 <1.0.0")
298
- expect(subject[:error][:multiline]).to include("Use `puppet module install 'pmtacceptance-mysql' --ignore-dependencies` to install only this module")
287
+ context 'with unsatisfiable dependencies' do
288
+ let(:graph) { double(SemanticPuppet::Dependency::Graph, :modules => ['pmtacceptance-mysql']) }
289
+ let(:exception) { SemanticPuppet::Dependency::UnsatisfiableGraph.new(graph, constraint) }
290
+
291
+ before do
292
+ allow(SemanticPuppet::Dependency).to receive(:resolve).and_raise(exception)
293
+ end
294
+
295
+ context 'with known constraint' do
296
+ let(:constraint) { 'pmtacceptance-mysql' }
297
+
298
+ it 'prints a detailed error containing the modules that would not be satisfied' do
299
+ expect(subject[:error]).to include(:multiline)
300
+ expect(subject[:error][:multiline]).to include("Could not install module 'pmtacceptance-mysql' (> 1.0.0)")
301
+ expect(subject[:error][:multiline]).to include("The requested version cannot satisfy one or more of the following installed modules:")
302
+ expect(subject[:error][:multiline]).to include("pmtacceptance-keystone, expects 'pmtacceptance-mysql': >=0.6.1 <1.0.0")
303
+ expect(subject[:error][:multiline]).to include("Use `puppet module install 'pmtacceptance-mysql' --ignore-dependencies` to install only this module")
304
+ end
305
+ end
306
+
307
+ context 'with missing constraint' do
308
+ let(:constraint) { nil }
309
+
310
+ it 'prints the generic error message' do
311
+ expect(subject[:error]).to include(:multiline)
312
+ expect(subject[:error][:multiline]).to include("Could not install module 'pmtacceptance-mysql' (> 1.0.0)")
313
+ expect(subject[:error][:multiline]).to include("The requested version cannot satisfy all dependencies")
314
+ end
315
+ end
316
+
317
+ context 'with unknown constraint' do
318
+ let(:constraint) { 'another' }
319
+
320
+ it 'prints the generic error message' do
321
+ expect(subject[:error]).to include(:multiline)
322
+ expect(subject[:error][:multiline]).to include("Could not install module 'pmtacceptance-mysql' (> 1.0.0)")
323
+ expect(subject[:error][:multiline]).to include("The requested version cannot satisfy all dependencies")
324
+ end
325
+ end
299
326
  end
300
327
 
301
328
  context 'with --ignore-dependencies' do
@@ -95,18 +95,7 @@ describe "egrammar parsing containers" do
95
95
  expect(dump(parse("class foo::default {}"))).to eq("(class foo::default ())")
96
96
  end
97
97
 
98
- it "class class inherits default {} # inherits default", :broken => true do
99
- expect {
100
- parse("class class inherits default {}")
101
- }.to raise_error(/not a valid classname/)
102
- end
103
-
104
98
  it "class class inherits default {} # inherits default" do
105
- # TODO: See previous test marked as :broken=>true, it is actually this test (result) that is wacky,
106
- # this because a class is named at parse time (since class evaluation is lazy, the model must have the
107
- # full class name for nested classes - only, it gets this wrong when a class is named "class" - or at least
108
- # I think it is wrong.)
109
- #
110
99
  expect { parse("class class inherits default {}") }.to raise_error(/'class' keyword not allowed at this location/)
111
100
  end
112
101
 
@@ -559,6 +559,29 @@ module Serialization
559
559
  expect(warnings).to eql(["['key'] contains the special value default. It will be converted to the String 'default'"])
560
560
  end
561
561
  end
562
+ context 'and force_symbol set to true' do
563
+ let(:to_converter) { ToDataConverter.new(:rich_data => false, :force_symbol => true) }
564
+
565
+ it 'A Hash with Symbol values is converted to hash with Symbol values' do
566
+ val = { 'one' => :one, 'two' => :two }
567
+ Puppet::Util::Log.with_destination(Puppet::Test::LogCollector.new(logs)) do
568
+
569
+ # write and read methods does not work here as we cannot force Symbols in Json.
570
+ # and a hash with symbol values cannot be an instance of Types::TypeFactory.data.
571
+ # Using YAML for this instead
572
+ io.reopen
573
+ value = to_converter.convert(val)
574
+ io << [value].to_yaml
575
+ io.rewind
576
+
577
+ val2 = from_converter.convert(YAML::load(io.read)[0])
578
+
579
+ expect(val2).to be_a(Hash)
580
+ expect(val2).to eql({ 'one' => :one, 'two' => :two })
581
+ end
582
+ expect(warnings).to be_empty
583
+ end
584
+ end
562
585
  end
563
586
 
564
587
  context 'with rich_data is set to true' do
@@ -632,6 +655,41 @@ module Serialization
632
655
  end.to raise_error(/Cannot create a Pcore::TimestampType from a Integer/)
633
656
  end
634
657
  end
658
+
659
+ context 'when data is unknown' do
660
+ let(:to_converter) { ToDataConverter.new(:message_prefix => 'Test Hash') }
661
+ let(:logs) { [] }
662
+ let(:warnings) { logs.select { |log| log.level == :warning }.map { |log| log.message } }
663
+ let(:val) { Class.new }
664
+
665
+ context 'and :silence_warnings undefined or set to false' do
666
+ it 'convert the unknown data to string with warnings' do
667
+ Puppet::Util::Log.with_destination(Puppet::Test::LogCollector.new(logs)) do
668
+ write(val)
669
+ val2 = read
670
+ expect(val2).to be_a(String)
671
+ expect(val2).to match(/Class/)
672
+ end
673
+ expect(warnings).to eql([
674
+ "Test Hash contains a #{val.class} value. It will be converted to the String '#{val.to_s}'"])
675
+ end
676
+ end
677
+
678
+ context 'and :silence_warnings undefined or set to true' do
679
+ let(:to_converter) { ToDataConverter.new(:message_prefix => 'Test Hash', :silence_warnings => true) }
680
+
681
+ it 'convert the unknown data to string without warnings if silence_warnings set to true' do
682
+ val = Class.new
683
+ Puppet::Util::Log.with_destination(Puppet::Test::LogCollector.new(logs)) do
684
+ write(val)
685
+ val2 = read
686
+ expect(val2).to be_a(String)
687
+ expect(val2).to match(/Class/)
688
+ end
689
+ expect(warnings).to be_empty
690
+ end
691
+ end
692
+ end
635
693
  end
636
694
  end
637
695
  end
@@ -342,14 +342,17 @@ describe Puppet::Type.type(:package).provider(:pkg), unless: Puppet::Util::Platf
342
342
  resource[:ensure] = '1.0-0.151006'
343
343
  is = :absent
344
344
  expect(provider).to receive(:query).with(no_args).and_return({:ensure => is})
345
- expect(provider).to receive(:properties).and_return({:mark => :hold})
345
+ expect(provider).to receive(:properties).and_return({:mark => :hold}).exactly(3).times
346
+
347
+ expect(described_class).to receive(:pkg)
348
+ .with(:freeze, 'dummy')
346
349
  expect(described_class).to receive(:pkg)
347
350
  .with(:list, '-Hvfa', 'dummy@1.0-0.151006')
348
351
  .and_return(Puppet::Util::Execution::ProcessOutput.new(File.read(my_fixture('dummy_implicit_version')), 0))
349
352
  expect(Puppet::Util::Execution).to receive(:execute)
350
353
  .with(['/bin/pkg', 'install', '-n', 'dummy@1.0,5.11-0.151006:20140220T084443Z'], {:failonfail => false, :combine => true})
351
354
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
352
- expect(provider).to receive(:unhold).with(no_args)
355
+ expect(provider).to receive(:unhold).with(no_args).twice
353
356
  expect(Puppet::Util::Execution).to receive(:execute)
354
357
  .with(['/bin/pkg', 'install', *hash[:flags], 'dummy@1.0,5.11-0.151006:20140220T084443Z'], {:failonfail => false, :combine => true})
355
358
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
@@ -361,12 +364,17 @@ describe Puppet::Type.type(:package).provider(:pkg), unless: Puppet::Util::Platf
361
364
  resource[:ensure] = '1.0-0.151006'
362
365
  is = '1.0,5.11-0.151006:20140219T191204Z'
363
366
  expect(provider).to receive(:query).with(no_args).and_return({:ensure => is})
364
- expect(provider).to receive(:properties).and_return({:mark => :hold})
365
- expect(described_class).to receive(:pkg).with(:list, '-Hvfa', 'dummy@1.0-0.151006').and_return(File.read(my_fixture('dummy_implicit_version')))
367
+ expect(provider).to receive(:properties).and_return({:mark => :hold}).exactly(3).times
368
+
369
+ expect(described_class).to receive(:pkg)
370
+ .with(:freeze, 'dummy')
371
+ expect(described_class).to receive(:pkg)
372
+ .with(:list, '-Hvfa', 'dummy@1.0-0.151006')
373
+ .and_return(File.read(my_fixture('dummy_implicit_version')))
366
374
  expect(Puppet::Util::Execution).to receive(:execute)
367
375
  .with(['/bin/pkg', 'update', '-n', 'dummy@1.0,5.11-0.151006:20140220T084443Z'], {:failonfail => false, :combine => true})
368
376
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
369
- expect(provider).to receive(:unhold).with(no_args)
377
+ expect(provider).to receive(:unhold).with(no_args).twice
370
378
  expect(Puppet::Util::Execution).to receive(:execute)
371
379
  .with(['/bin/pkg', 'update', *hash[:flags], 'dummy@1.0,5.11-0.151006:20140220T084443Z'], {:failonfail => false, :combine => true})
372
380
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
@@ -381,6 +389,9 @@ describe Puppet::Type.type(:package).provider(:pkg), unless: Puppet::Util::Platf
381
389
  expect(described_class).to receive(:pkg)
382
390
  .with(:list, '-Hvfa', 'dummy@1.0-0.151006')
383
391
  .and_return(Puppet::Util::Execution::ProcessOutput.new(File.read(my_fixture('dummy_implicit_version')), 0))
392
+ expect(Puppet::Util::Execution).to receive(:execute)
393
+ .with(['/bin/pkg', 'list', '-Hv', 'dummy'], {:failonfail => false, :combine => true})
394
+ .and_return(Puppet::Util::Execution::ProcessOutput.new(File.read(my_fixture('dummy_implicit_version')), 0))
384
395
  expect(Puppet::Util::Execution).to receive(:execute)
385
396
  .with(['/bin/pkg', 'update', '-n', 'dummy@1.0,5.11-0.151006:20140220T084443Z'], {:failonfail => false, :combine => true})
386
397
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 4))
@@ -395,6 +406,9 @@ describe Puppet::Type.type(:package).provider(:pkg), unless: Puppet::Util::Platf
395
406
  expect(described_class).to receive(:pkg)
396
407
  .with(:list, '-Hvfa', 'dummy@1.0-0.151006')
397
408
  .and_return(Puppet::Util::Execution::ProcessOutput.new(File.read(my_fixture('dummy_implicit_version')), 0))
409
+ expect(Puppet::Util::Execution).to receive(:execute)
410
+ .with(['/bin/pkg', 'list', '-Hv', 'dummy'], {:failonfail => false, :combine => true})
411
+ .and_return(Puppet::Util::Execution::ProcessOutput.new(File.read(my_fixture('dummy_implicit_version')), 0))
398
412
  expect(Puppet::Util::Execution).to receive(:execute)
399
413
  .with(['/bin/pkg', 'install', '-n', 'dummy@1.0,5.11-0.151006:20140220T084443Z'], {:failonfail => false, :combine => true})
400
414
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
@@ -325,6 +325,7 @@ describe 'Puppet::Type::Service::Provider::Launchd',
325
325
  'LimitLoadToSessionType' => 'Aqua'
326
326
  }
327
327
  end
328
+ let(:plist_without_label_not_hash) { 'just a string' }
328
329
  let(:busted_plist_path) { '/Library/LaunchAgents/org.busted.plist' }
329
330
  let(:binary_plist_path) { '/Library/LaunchAgents/org.binary.plist' }
330
331
 
@@ -336,6 +337,16 @@ describe 'Puppet::Type::Service::Provider::Launchd',
336
337
  expect(Puppet).to receive(:debug).with("The #{busted_plist_path} plist does not contain a 'label' key; Puppet is skipping it")
337
338
  provider.make_label_to_path_map
338
339
  end
340
+
341
+ it "it should warn that the malformed plist in question is being skipped" do
342
+ expect(provider).to receive(:launchd_paths).and_return(['/Library/LaunchAgents'])
343
+ expect(provider).to receive(:return_globbed_list_of_file_paths).with('/Library/LaunchAgents').and_return([busted_plist_path])
344
+ expect(plistlib).to receive(:read_plist_file).with(busted_plist_path).and_return(plist_without_label_not_hash)
345
+ expect(Puppet).to receive(:debug).with("Reading launchd plist #{busted_plist_path}")
346
+ expect(Puppet).to receive(:debug).with("The #{busted_plist_path} plist does not contain a 'label' key; Puppet is skipping it")
347
+ provider.make_label_to_path_map
348
+ end
349
+
339
350
  end
340
351
 
341
352
  it "should return the cached value when available" do
@@ -29,7 +29,7 @@ describe 'Puppet::Type::Service::Provider::Systemd',
29
29
  end
30
30
  end
31
31
 
32
- [7, 8].each do |ver|
32
+ [7, 8, 9].each do |ver|
33
33
  it "should be the default provider on rhel#{ver}" do
34
34
  allow(Facter).to receive(:value).with(:osfamily).and_return(:redhat)
35
35
  allow(Facter).to receive(:value).with(:operatingsystem).and_return(:redhat)
@@ -13,6 +13,7 @@ describe Puppet::Type.type(:user).provider(:useradd) do
13
13
  allow(described_class).to receive(:command).with(:localmodify).and_return('/usr/sbin/lusermod')
14
14
  allow(described_class).to receive(:command).with(:delete).and_return('/usr/sbin/userdel')
15
15
  allow(described_class).to receive(:command).with(:localdelete).and_return('/usr/sbin/luserdel')
16
+ allow(described_class).to receive(:command).with(:chpasswd).and_return('/usr/sbin/chpasswd')
16
17
  end
17
18
 
18
19
  let(:resource) do
@@ -62,7 +63,7 @@ describe Puppet::Type.type(:user).provider(:useradd) do
62
63
  :provider => provider,
63
64
  )
64
65
  resource2[:ensure] = :present
65
- expect(provider).to receive(:execute).with(kind_of(Array), hash_including(sensitive: true))
66
+ expect(provider).to receive(:execute).with(kind_of(Array), hash_including(sensitive: true)).twice
66
67
  provider.create
67
68
  end
68
69
 
@@ -208,7 +209,7 @@ describe Puppet::Type.type(:user).provider(:useradd) do
208
209
  end
209
210
 
210
211
  it "should call execute with sensitive if sensitive data is changed" do
211
- expect(provider).to receive(:execute).with(kind_of(Array), hash_including(sensitive: true))
212
+ expect(provider).to receive(:execute).with(kind_of(Array), hash_including(sensitive: true)).and_return('')
212
213
  provider.password = 'bird bird bird'
213
214
  end
214
215
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.9.0
4
+ version: 7.10.0
5
5
  platform: universal-darwin
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -197,6 +197,13 @@ files:
197
197
  - conf/fileserver.conf
198
198
  - conf/hiera.yaml
199
199
  - conf/puppet.conf
200
+ - examples/enc/regexp_nodes/classes/databases
201
+ - examples/enc/regexp_nodes/classes/webservers
202
+ - examples/enc/regexp_nodes/environment/development
203
+ - examples/enc/regexp_nodes/parameters/service/prod
204
+ - examples/enc/regexp_nodes/parameters/service/qa
205
+ - examples/enc/regexp_nodes/parameters/service/sandbox
206
+ - examples/enc/regexp_nodes/regexp_nodes.rb
200
207
  - examples/hiera/README.md
201
208
  - examples/hiera/etc/hiera.yaml
202
209
  - examples/hiera/etc/hieradb/common.yaml
@@ -211,113 +218,25 @@ files:
211
218
  - examples/hiera/modules/users/manifests/dc1.pp
212
219
  - examples/hiera/modules/users/manifests/development.pp
213
220
  - examples/hiera/site.pp
214
- - ext/README.environment
221
+ - examples/nagios/check_puppet.rb
222
+ - ext/README.md
215
223
  - ext/build_defaults.yaml
216
- - ext/dbfix.sql
217
- - ext/debian/README.Debian
218
- - ext/debian/README.source
219
- - ext/debian/TODO.Debian
220
- - ext/debian/changelog.erb
221
- - ext/debian/compat
222
- - ext/debian/control
223
- - ext/debian/copyright
224
- - ext/debian/docs
225
- - ext/debian/fileserver.conf
226
- - ext/debian/puppet-common.dirs
227
- - ext/debian/puppet-common.install
228
- - ext/debian/puppet-common.lintian-overrides
229
- - ext/debian/puppet-common.manpages
230
- - ext/debian/puppet-common.postinst
231
- - ext/debian/puppet-common.postrm
232
- - ext/debian/puppet-el.dirs
233
- - ext/debian/puppet-el.emacsen-install
234
- - ext/debian/puppet-el.emacsen-remove
235
- - ext/debian/puppet-el.emacsen-startup
236
- - ext/debian/puppet-el.install
237
- - ext/debian/puppet-testsuite.install
238
- - ext/debian/puppet-testsuite.lintian-overrides
239
224
  - ext/debian/puppet.default
240
225
  - ext/debian/puppet.init
241
- - ext/debian/puppet.lintian-overrides
242
- - ext/debian/puppet.logrotate
243
- - ext/debian/puppet.postinst
244
- - ext/debian/puppet.postrm
245
- - ext/debian/puppet.preinst
246
- - ext/debian/puppetmaster-common.install
247
- - ext/debian/puppetmaster-common.manpages
248
- - ext/debian/puppetmaster-common.postinst
249
- - ext/debian/puppetmaster-passenger.dirs
250
- - ext/debian/puppetmaster-passenger.postinst
251
- - ext/debian/puppetmaster-passenger.postrm
252
- - ext/debian/puppetmaster.README.debian
253
- - ext/debian/puppetmaster.default
254
- - ext/debian/puppetmaster.init
255
- - ext/debian/puppetmaster.lintian-overrides
256
- - ext/debian/puppetmaster.postinst
257
- - ext/debian/puppetmaster.postrm
258
- - ext/debian/puppetmaster.preinst
259
- - ext/debian/rules
260
- - ext/debian/source/format
261
- - ext/debian/source/options
262
- - ext/debian/vim-puppet.README.Debian
263
- - ext/debian/vim-puppet.dirs
264
- - ext/debian/vim-puppet.yaml
265
- - ext/debian/watch
266
- - ext/freebsd/puppetd
267
- - ext/freebsd/puppetmasterd
268
- - ext/gentoo/conf.d/puppet
269
- - ext/gentoo/conf.d/puppetmaster
270
- - ext/gentoo/init.d/puppet
271
- - ext/gentoo/init.d/puppetmaster
272
- - ext/gentoo/puppet/fileserver.conf
273
226
  - ext/hiera/hiera.yaml
274
- - ext/ips/puppet-agent
275
- - ext/ips/puppet-master
276
- - ext/ips/puppet.p5m.erb
277
- - ext/ips/puppetagent.xml
278
- - ext/ips/puppetmaster.xml
279
- - ext/ips/rules
280
- - ext/ips/transforms
281
- - ext/ldap/puppet.schema
282
- - ext/logcheck/puppet
283
- - ext/nagios/check_puppet.rb
284
- - ext/osx/file_mapping.yaml
285
- - ext/osx/postflight.erb
286
- - ext/osx/preflight.erb
287
- - ext/osx/prototype.plist.erb
288
227
  - ext/osx/puppet.plist
289
228
  - ext/project_data.yaml
290
229
  - ext/redhat/client.init
291
230
  - ext/redhat/client.sysconfig
292
- - ext/redhat/fileserver.conf
293
- - ext/redhat/logrotate
294
- - ext/redhat/puppet.spec.erb
295
- - ext/redhat/server.init
296
- - ext/redhat/server.sysconfig
297
- - ext/regexp_nodes/classes/databases
298
- - ext/regexp_nodes/classes/webservers
299
- - ext/regexp_nodes/environment/development
300
- - ext/regexp_nodes/parameters/service/prod
301
- - ext/regexp_nodes/parameters/service/qa
302
- - ext/regexp_nodes/parameters/service/sandbox
303
- - ext/regexp_nodes/regexp_nodes.rb
304
- - ext/solaris/pkginfo
305
231
  - ext/solaris/smf/puppet
306
232
  - ext/solaris/smf/puppet.xml
307
- - ext/solaris/smf/puppetd.xml
308
- - ext/solaris/smf/puppetmasterd.xml
309
- - ext/solaris/smf/svc-puppetd
310
- - ext/solaris/smf/svc-puppetmasterd
311
233
  - ext/suse/client.init
312
- - ext/suse/puppet.spec
313
- - ext/suse/server.init
314
234
  - ext/systemd/puppet.service
315
235
  - ext/windows/puppet_interactive.bat
316
236
  - ext/windows/puppet_shell.bat
317
237
  - ext/windows/run_puppet_interactive.bat
318
238
  - ext/windows/service/daemon.bat
319
239
  - ext/windows/service/daemon.rb
320
- - ext/yaml_nodes.rb
321
240
  - install.rb
322
241
  - lib/hiera/puppet_function.rb
323
242
  - lib/hiera/scope.rb
@@ -450,6 +369,7 @@ files:
450
369
  - lib/puppet/file_serving/mount/modules.rb
451
370
  - lib/puppet/file_serving/mount/pluginfacts.rb
452
371
  - lib/puppet/file_serving/mount/plugins.rb
372
+ - lib/puppet/file_serving/mount/scripts.rb
453
373
  - lib/puppet/file_serving/mount/tasks.rb
454
374
  - lib/puppet/file_serving/terminus_helper.rb
455
375
  - lib/puppet/file_serving/terminus_selector.rb
@@ -1373,8 +1293,16 @@ files:
1373
1293
  - spec/fixtures/faulty_face/puppet/face/syntax.rb
1374
1294
  - spec/fixtures/hiera.yaml
1375
1295
  - spec/fixtures/integration/application/agent/cached_deferred_catalog.json
1296
+ - spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
1376
1297
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
1377
1298
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
1299
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
1300
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
1301
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
1302
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml
1303
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po
1304
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot
1305
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json
1378
1306
  - spec/fixtures/integration/node/environment/sitedir/00_a.pp
1379
1307
  - spec/fixtures/integration/node/environment/sitedir/01_b.pp
1380
1308
  - spec/fixtures/integration/node/environment/sitedir/03_empty.pp
@@ -1800,6 +1728,7 @@ files:
1800
1728
  - spec/integration/indirector/facts/facter_spec.rb
1801
1729
  - spec/integration/indirector/file_content/file_server_spec.rb
1802
1730
  - spec/integration/indirector/file_metadata/file_server_spec.rb
1731
+ - spec/integration/l10n/compiler_spec.rb
1803
1732
  - spec/integration/network/formats_spec.rb
1804
1733
  - spec/integration/network/http/api/indirected_routes_spec.rb
1805
1734
  - spec/integration/network/http_pool_spec.rb
@@ -1895,6 +1824,7 @@ files:
1895
1824
  - spec/shared_contexts/checksum.rb
1896
1825
  - spec/shared_contexts/digests.rb
1897
1826
  - spec/shared_contexts/https.rb
1827
+ - spec/shared_contexts/l10n.rb
1898
1828
  - spec/shared_contexts/provider.rb
1899
1829
  - spec/shared_contexts/types_setup.rb
1900
1830
  - spec/shared_examples/rhel_package_provider.rb
@@ -1968,6 +1898,7 @@ files:
1968
1898
  - spec/unit/file_serving/mount/modules_spec.rb
1969
1899
  - spec/unit/file_serving/mount/pluginfacts_spec.rb
1970
1900
  - spec/unit/file_serving/mount/plugins_spec.rb
1901
+ - spec/unit/file_serving/mount/scripts_spec.rb
1971
1902
  - spec/unit/file_serving/mount/tasks_spec.rb
1972
1903
  - spec/unit/file_serving/mount_spec.rb
1973
1904
  - spec/unit/file_serving/terminus_helper_spec.rb
@@ -2137,7 +2068,6 @@ files:
2137
2068
  - spec/unit/indirector/resource/ral_spec.rb
2138
2069
  - spec/unit/indirector/resource/store_configs_spec.rb
2139
2070
  - spec/unit/indirector/rest_spec.rb
2140
- - spec/unit/indirector/store_configs_spec.rb
2141
2071
  - spec/unit/indirector/terminus_spec.rb
2142
2072
  - spec/unit/indirector/yaml_spec.rb
2143
2073
  - spec/unit/indirector_spec.rb
@@ -2619,8 +2549,16 @@ test_files:
2619
2549
  - spec/fixtures/faulty_face/puppet/face/syntax.rb
2620
2550
  - spec/fixtures/hiera.yaml
2621
2551
  - spec/fixtures/integration/application/agent/cached_deferred_catalog.json
2552
+ - spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
2622
2553
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
2623
2554
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
2555
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
2556
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
2557
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
2558
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml
2559
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po
2560
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot
2561
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json
2624
2562
  - spec/fixtures/integration/node/environment/sitedir/00_a.pp
2625
2563
  - spec/fixtures/integration/node/environment/sitedir/01_b.pp
2626
2564
  - spec/fixtures/integration/node/environment/sitedir/03_empty.pp
@@ -3046,6 +2984,7 @@ test_files:
3046
2984
  - spec/integration/indirector/facts/facter_spec.rb
3047
2985
  - spec/integration/indirector/file_content/file_server_spec.rb
3048
2986
  - spec/integration/indirector/file_metadata/file_server_spec.rb
2987
+ - spec/integration/l10n/compiler_spec.rb
3049
2988
  - spec/integration/network/formats_spec.rb
3050
2989
  - spec/integration/network/http/api/indirected_routes_spec.rb
3051
2990
  - spec/integration/network/http_pool_spec.rb
@@ -3141,6 +3080,7 @@ test_files:
3141
3080
  - spec/shared_contexts/checksum.rb
3142
3081
  - spec/shared_contexts/digests.rb
3143
3082
  - spec/shared_contexts/https.rb
3083
+ - spec/shared_contexts/l10n.rb
3144
3084
  - spec/shared_contexts/provider.rb
3145
3085
  - spec/shared_contexts/types_setup.rb
3146
3086
  - spec/shared_examples/rhel_package_provider.rb
@@ -3214,6 +3154,7 @@ test_files:
3214
3154
  - spec/unit/file_serving/mount/modules_spec.rb
3215
3155
  - spec/unit/file_serving/mount/pluginfacts_spec.rb
3216
3156
  - spec/unit/file_serving/mount/plugins_spec.rb
3157
+ - spec/unit/file_serving/mount/scripts_spec.rb
3217
3158
  - spec/unit/file_serving/mount/tasks_spec.rb
3218
3159
  - spec/unit/file_serving/mount_spec.rb
3219
3160
  - spec/unit/file_serving/terminus_helper_spec.rb
@@ -3383,7 +3324,6 @@ test_files:
3383
3324
  - spec/unit/indirector/resource/ral_spec.rb
3384
3325
  - spec/unit/indirector/resource/store_configs_spec.rb
3385
3326
  - spec/unit/indirector/rest_spec.rb
3386
- - spec/unit/indirector/store_configs_spec.rb
3387
3327
  - spec/unit/indirector/terminus_spec.rb
3388
3328
  - spec/unit/indirector/yaml_spec.rb
3389
3329
  - spec/unit/indirector_spec.rb