puppet 7.9.0 → 7.10.0

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: ruby
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
@@ -183,6 +183,13 @@ files:
183
183
  - conf/fileserver.conf
184
184
  - conf/hiera.yaml
185
185
  - conf/puppet.conf
186
+ - examples/enc/regexp_nodes/classes/databases
187
+ - examples/enc/regexp_nodes/classes/webservers
188
+ - examples/enc/regexp_nodes/environment/development
189
+ - examples/enc/regexp_nodes/parameters/service/prod
190
+ - examples/enc/regexp_nodes/parameters/service/qa
191
+ - examples/enc/regexp_nodes/parameters/service/sandbox
192
+ - examples/enc/regexp_nodes/regexp_nodes.rb
186
193
  - examples/hiera/README.md
187
194
  - examples/hiera/etc/hiera.yaml
188
195
  - examples/hiera/etc/hieradb/common.yaml
@@ -197,113 +204,25 @@ files:
197
204
  - examples/hiera/modules/users/manifests/dc1.pp
198
205
  - examples/hiera/modules/users/manifests/development.pp
199
206
  - examples/hiera/site.pp
200
- - ext/README.environment
207
+ - examples/nagios/check_puppet.rb
208
+ - ext/README.md
201
209
  - ext/build_defaults.yaml
202
- - ext/dbfix.sql
203
- - ext/debian/README.Debian
204
- - ext/debian/README.source
205
- - ext/debian/TODO.Debian
206
- - ext/debian/changelog.erb
207
- - ext/debian/compat
208
- - ext/debian/control
209
- - ext/debian/copyright
210
- - ext/debian/docs
211
- - ext/debian/fileserver.conf
212
- - ext/debian/puppet-common.dirs
213
- - ext/debian/puppet-common.install
214
- - ext/debian/puppet-common.lintian-overrides
215
- - ext/debian/puppet-common.manpages
216
- - ext/debian/puppet-common.postinst
217
- - ext/debian/puppet-common.postrm
218
- - ext/debian/puppet-el.dirs
219
- - ext/debian/puppet-el.emacsen-install
220
- - ext/debian/puppet-el.emacsen-remove
221
- - ext/debian/puppet-el.emacsen-startup
222
- - ext/debian/puppet-el.install
223
- - ext/debian/puppet-testsuite.install
224
- - ext/debian/puppet-testsuite.lintian-overrides
225
210
  - ext/debian/puppet.default
226
211
  - ext/debian/puppet.init
227
- - ext/debian/puppet.lintian-overrides
228
- - ext/debian/puppet.logrotate
229
- - ext/debian/puppet.postinst
230
- - ext/debian/puppet.postrm
231
- - ext/debian/puppet.preinst
232
- - ext/debian/puppetmaster-common.install
233
- - ext/debian/puppetmaster-common.manpages
234
- - ext/debian/puppetmaster-common.postinst
235
- - ext/debian/puppetmaster-passenger.dirs
236
- - ext/debian/puppetmaster-passenger.postinst
237
- - ext/debian/puppetmaster-passenger.postrm
238
- - ext/debian/puppetmaster.README.debian
239
- - ext/debian/puppetmaster.default
240
- - ext/debian/puppetmaster.init
241
- - ext/debian/puppetmaster.lintian-overrides
242
- - ext/debian/puppetmaster.postinst
243
- - ext/debian/puppetmaster.postrm
244
- - ext/debian/puppetmaster.preinst
245
- - ext/debian/rules
246
- - ext/debian/source/format
247
- - ext/debian/source/options
248
- - ext/debian/vim-puppet.README.Debian
249
- - ext/debian/vim-puppet.dirs
250
- - ext/debian/vim-puppet.yaml
251
- - ext/debian/watch
252
- - ext/freebsd/puppetd
253
- - ext/freebsd/puppetmasterd
254
- - ext/gentoo/conf.d/puppet
255
- - ext/gentoo/conf.d/puppetmaster
256
- - ext/gentoo/init.d/puppet
257
- - ext/gentoo/init.d/puppetmaster
258
- - ext/gentoo/puppet/fileserver.conf
259
212
  - ext/hiera/hiera.yaml
260
- - ext/ips/puppet-agent
261
- - ext/ips/puppet-master
262
- - ext/ips/puppet.p5m.erb
263
- - ext/ips/puppetagent.xml
264
- - ext/ips/puppetmaster.xml
265
- - ext/ips/rules
266
- - ext/ips/transforms
267
- - ext/ldap/puppet.schema
268
- - ext/logcheck/puppet
269
- - ext/nagios/check_puppet.rb
270
- - ext/osx/file_mapping.yaml
271
- - ext/osx/postflight.erb
272
- - ext/osx/preflight.erb
273
- - ext/osx/prototype.plist.erb
274
213
  - ext/osx/puppet.plist
275
214
  - ext/project_data.yaml
276
215
  - ext/redhat/client.init
277
216
  - ext/redhat/client.sysconfig
278
- - ext/redhat/fileserver.conf
279
- - ext/redhat/logrotate
280
- - ext/redhat/puppet.spec.erb
281
- - ext/redhat/server.init
282
- - ext/redhat/server.sysconfig
283
- - ext/regexp_nodes/classes/databases
284
- - ext/regexp_nodes/classes/webservers
285
- - ext/regexp_nodes/environment/development
286
- - ext/regexp_nodes/parameters/service/prod
287
- - ext/regexp_nodes/parameters/service/qa
288
- - ext/regexp_nodes/parameters/service/sandbox
289
- - ext/regexp_nodes/regexp_nodes.rb
290
- - ext/solaris/pkginfo
291
217
  - ext/solaris/smf/puppet
292
218
  - ext/solaris/smf/puppet.xml
293
- - ext/solaris/smf/puppetd.xml
294
- - ext/solaris/smf/puppetmasterd.xml
295
- - ext/solaris/smf/svc-puppetd
296
- - ext/solaris/smf/svc-puppetmasterd
297
219
  - ext/suse/client.init
298
- - ext/suse/puppet.spec
299
- - ext/suse/server.init
300
220
  - ext/systemd/puppet.service
301
221
  - ext/windows/puppet_interactive.bat
302
222
  - ext/windows/puppet_shell.bat
303
223
  - ext/windows/run_puppet_interactive.bat
304
224
  - ext/windows/service/daemon.bat
305
225
  - ext/windows/service/daemon.rb
306
- - ext/yaml_nodes.rb
307
226
  - install.rb
308
227
  - lib/hiera/puppet_function.rb
309
228
  - lib/hiera/scope.rb
@@ -436,6 +355,7 @@ files:
436
355
  - lib/puppet/file_serving/mount/modules.rb
437
356
  - lib/puppet/file_serving/mount/pluginfacts.rb
438
357
  - lib/puppet/file_serving/mount/plugins.rb
358
+ - lib/puppet/file_serving/mount/scripts.rb
439
359
  - lib/puppet/file_serving/mount/tasks.rb
440
360
  - lib/puppet/file_serving/terminus_helper.rb
441
361
  - lib/puppet/file_serving/terminus_selector.rb
@@ -1359,8 +1279,16 @@ files:
1359
1279
  - spec/fixtures/faulty_face/puppet/face/syntax.rb
1360
1280
  - spec/fixtures/hiera.yaml
1361
1281
  - spec/fixtures/integration/application/agent/cached_deferred_catalog.json
1282
+ - spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
1362
1283
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
1363
1284
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
1285
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
1286
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
1287
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
1288
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml
1289
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po
1290
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot
1291
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json
1364
1292
  - spec/fixtures/integration/node/environment/sitedir/00_a.pp
1365
1293
  - spec/fixtures/integration/node/environment/sitedir/01_b.pp
1366
1294
  - spec/fixtures/integration/node/environment/sitedir/03_empty.pp
@@ -1786,6 +1714,7 @@ files:
1786
1714
  - spec/integration/indirector/facts/facter_spec.rb
1787
1715
  - spec/integration/indirector/file_content/file_server_spec.rb
1788
1716
  - spec/integration/indirector/file_metadata/file_server_spec.rb
1717
+ - spec/integration/l10n/compiler_spec.rb
1789
1718
  - spec/integration/network/formats_spec.rb
1790
1719
  - spec/integration/network/http/api/indirected_routes_spec.rb
1791
1720
  - spec/integration/network/http_pool_spec.rb
@@ -1881,6 +1810,7 @@ files:
1881
1810
  - spec/shared_contexts/checksum.rb
1882
1811
  - spec/shared_contexts/digests.rb
1883
1812
  - spec/shared_contexts/https.rb
1813
+ - spec/shared_contexts/l10n.rb
1884
1814
  - spec/shared_contexts/provider.rb
1885
1815
  - spec/shared_contexts/types_setup.rb
1886
1816
  - spec/shared_examples/rhel_package_provider.rb
@@ -1954,6 +1884,7 @@ files:
1954
1884
  - spec/unit/file_serving/mount/modules_spec.rb
1955
1885
  - spec/unit/file_serving/mount/pluginfacts_spec.rb
1956
1886
  - spec/unit/file_serving/mount/plugins_spec.rb
1887
+ - spec/unit/file_serving/mount/scripts_spec.rb
1957
1888
  - spec/unit/file_serving/mount/tasks_spec.rb
1958
1889
  - spec/unit/file_serving/mount_spec.rb
1959
1890
  - spec/unit/file_serving/terminus_helper_spec.rb
@@ -2123,7 +2054,6 @@ files:
2123
2054
  - spec/unit/indirector/resource/ral_spec.rb
2124
2055
  - spec/unit/indirector/resource/store_configs_spec.rb
2125
2056
  - spec/unit/indirector/rest_spec.rb
2126
- - spec/unit/indirector/store_configs_spec.rb
2127
2057
  - spec/unit/indirector/terminus_spec.rb
2128
2058
  - spec/unit/indirector/yaml_spec.rb
2129
2059
  - spec/unit/indirector_spec.rb
@@ -2605,8 +2535,16 @@ test_files:
2605
2535
  - spec/fixtures/faulty_face/puppet/face/syntax.rb
2606
2536
  - spec/fixtures/hiera.yaml
2607
2537
  - spec/fixtures/integration/application/agent/cached_deferred_catalog.json
2538
+ - spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
2608
2539
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
2609
2540
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
2541
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
2542
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
2543
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
2544
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml
2545
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po
2546
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot
2547
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json
2610
2548
  - spec/fixtures/integration/node/environment/sitedir/00_a.pp
2611
2549
  - spec/fixtures/integration/node/environment/sitedir/01_b.pp
2612
2550
  - spec/fixtures/integration/node/environment/sitedir/03_empty.pp
@@ -3032,6 +2970,7 @@ test_files:
3032
2970
  - spec/integration/indirector/facts/facter_spec.rb
3033
2971
  - spec/integration/indirector/file_content/file_server_spec.rb
3034
2972
  - spec/integration/indirector/file_metadata/file_server_spec.rb
2973
+ - spec/integration/l10n/compiler_spec.rb
3035
2974
  - spec/integration/network/formats_spec.rb
3036
2975
  - spec/integration/network/http/api/indirected_routes_spec.rb
3037
2976
  - spec/integration/network/http_pool_spec.rb
@@ -3127,6 +3066,7 @@ test_files:
3127
3066
  - spec/shared_contexts/checksum.rb
3128
3067
  - spec/shared_contexts/digests.rb
3129
3068
  - spec/shared_contexts/https.rb
3069
+ - spec/shared_contexts/l10n.rb
3130
3070
  - spec/shared_contexts/provider.rb
3131
3071
  - spec/shared_contexts/types_setup.rb
3132
3072
  - spec/shared_examples/rhel_package_provider.rb
@@ -3200,6 +3140,7 @@ test_files:
3200
3140
  - spec/unit/file_serving/mount/modules_spec.rb
3201
3141
  - spec/unit/file_serving/mount/pluginfacts_spec.rb
3202
3142
  - spec/unit/file_serving/mount/plugins_spec.rb
3143
+ - spec/unit/file_serving/mount/scripts_spec.rb
3203
3144
  - spec/unit/file_serving/mount/tasks_spec.rb
3204
3145
  - spec/unit/file_serving/mount_spec.rb
3205
3146
  - spec/unit/file_serving/terminus_helper_spec.rb
@@ -3369,7 +3310,6 @@ test_files:
3369
3310
  - spec/unit/indirector/resource/ral_spec.rb
3370
3311
  - spec/unit/indirector/resource/store_configs_spec.rb
3371
3312
  - spec/unit/indirector/rest_spec.rb
3372
- - spec/unit/indirector/store_configs_spec.rb
3373
3313
  - spec/unit/indirector/terminus_spec.rb
3374
3314
  - spec/unit/indirector/yaml_spec.rb
3375
3315
  - spec/unit/indirector_spec.rb