puppet 7.9.0-x64-mingw32 → 7.10.0-x64-mingw32

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: x64-mingw32
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
@@ -217,6 +217,13 @@ files:
217
217
  - conf/fileserver.conf
218
218
  - conf/hiera.yaml
219
219
  - conf/puppet.conf
220
+ - examples/enc/regexp_nodes/classes/databases
221
+ - examples/enc/regexp_nodes/classes/webservers
222
+ - examples/enc/regexp_nodes/environment/development
223
+ - examples/enc/regexp_nodes/parameters/service/prod
224
+ - examples/enc/regexp_nodes/parameters/service/qa
225
+ - examples/enc/regexp_nodes/parameters/service/sandbox
226
+ - examples/enc/regexp_nodes/regexp_nodes.rb
220
227
  - examples/hiera/README.md
221
228
  - examples/hiera/etc/hiera.yaml
222
229
  - examples/hiera/etc/hieradb/common.yaml
@@ -231,113 +238,25 @@ files:
231
238
  - examples/hiera/modules/users/manifests/dc1.pp
232
239
  - examples/hiera/modules/users/manifests/development.pp
233
240
  - examples/hiera/site.pp
234
- - ext/README.environment
241
+ - examples/nagios/check_puppet.rb
242
+ - ext/README.md
235
243
  - ext/build_defaults.yaml
236
- - ext/dbfix.sql
237
- - ext/debian/README.Debian
238
- - ext/debian/README.source
239
- - ext/debian/TODO.Debian
240
- - ext/debian/changelog.erb
241
- - ext/debian/compat
242
- - ext/debian/control
243
- - ext/debian/copyright
244
- - ext/debian/docs
245
- - ext/debian/fileserver.conf
246
- - ext/debian/puppet-common.dirs
247
- - ext/debian/puppet-common.install
248
- - ext/debian/puppet-common.lintian-overrides
249
- - ext/debian/puppet-common.manpages
250
- - ext/debian/puppet-common.postinst
251
- - ext/debian/puppet-common.postrm
252
- - ext/debian/puppet-el.dirs
253
- - ext/debian/puppet-el.emacsen-install
254
- - ext/debian/puppet-el.emacsen-remove
255
- - ext/debian/puppet-el.emacsen-startup
256
- - ext/debian/puppet-el.install
257
- - ext/debian/puppet-testsuite.install
258
- - ext/debian/puppet-testsuite.lintian-overrides
259
244
  - ext/debian/puppet.default
260
245
  - ext/debian/puppet.init
261
- - ext/debian/puppet.lintian-overrides
262
- - ext/debian/puppet.logrotate
263
- - ext/debian/puppet.postinst
264
- - ext/debian/puppet.postrm
265
- - ext/debian/puppet.preinst
266
- - ext/debian/puppetmaster-common.install
267
- - ext/debian/puppetmaster-common.manpages
268
- - ext/debian/puppetmaster-common.postinst
269
- - ext/debian/puppetmaster-passenger.dirs
270
- - ext/debian/puppetmaster-passenger.postinst
271
- - ext/debian/puppetmaster-passenger.postrm
272
- - ext/debian/puppetmaster.README.debian
273
- - ext/debian/puppetmaster.default
274
- - ext/debian/puppetmaster.init
275
- - ext/debian/puppetmaster.lintian-overrides
276
- - ext/debian/puppetmaster.postinst
277
- - ext/debian/puppetmaster.postrm
278
- - ext/debian/puppetmaster.preinst
279
- - ext/debian/rules
280
- - ext/debian/source/format
281
- - ext/debian/source/options
282
- - ext/debian/vim-puppet.README.Debian
283
- - ext/debian/vim-puppet.dirs
284
- - ext/debian/vim-puppet.yaml
285
- - ext/debian/watch
286
- - ext/freebsd/puppetd
287
- - ext/freebsd/puppetmasterd
288
- - ext/gentoo/conf.d/puppet
289
- - ext/gentoo/conf.d/puppetmaster
290
- - ext/gentoo/init.d/puppet
291
- - ext/gentoo/init.d/puppetmaster
292
- - ext/gentoo/puppet/fileserver.conf
293
246
  - ext/hiera/hiera.yaml
294
- - ext/ips/puppet-agent
295
- - ext/ips/puppet-master
296
- - ext/ips/puppet.p5m.erb
297
- - ext/ips/puppetagent.xml
298
- - ext/ips/puppetmaster.xml
299
- - ext/ips/rules
300
- - ext/ips/transforms
301
- - ext/ldap/puppet.schema
302
- - ext/logcheck/puppet
303
- - ext/nagios/check_puppet.rb
304
- - ext/osx/file_mapping.yaml
305
- - ext/osx/postflight.erb
306
- - ext/osx/preflight.erb
307
- - ext/osx/prototype.plist.erb
308
247
  - ext/osx/puppet.plist
309
248
  - ext/project_data.yaml
310
249
  - ext/redhat/client.init
311
250
  - ext/redhat/client.sysconfig
312
- - ext/redhat/fileserver.conf
313
- - ext/redhat/logrotate
314
- - ext/redhat/puppet.spec.erb
315
- - ext/redhat/server.init
316
- - ext/redhat/server.sysconfig
317
- - ext/regexp_nodes/classes/databases
318
- - ext/regexp_nodes/classes/webservers
319
- - ext/regexp_nodes/environment/development
320
- - ext/regexp_nodes/parameters/service/prod
321
- - ext/regexp_nodes/parameters/service/qa
322
- - ext/regexp_nodes/parameters/service/sandbox
323
- - ext/regexp_nodes/regexp_nodes.rb
324
- - ext/solaris/pkginfo
325
251
  - ext/solaris/smf/puppet
326
252
  - ext/solaris/smf/puppet.xml
327
- - ext/solaris/smf/puppetd.xml
328
- - ext/solaris/smf/puppetmasterd.xml
329
- - ext/solaris/smf/svc-puppetd
330
- - ext/solaris/smf/svc-puppetmasterd
331
253
  - ext/suse/client.init
332
- - ext/suse/puppet.spec
333
- - ext/suse/server.init
334
254
  - ext/systemd/puppet.service
335
255
  - ext/windows/puppet_interactive.bat
336
256
  - ext/windows/puppet_shell.bat
337
257
  - ext/windows/run_puppet_interactive.bat
338
258
  - ext/windows/service/daemon.bat
339
259
  - ext/windows/service/daemon.rb
340
- - ext/yaml_nodes.rb
341
260
  - install.rb
342
261
  - lib/hiera/puppet_function.rb
343
262
  - lib/hiera/scope.rb
@@ -470,6 +389,7 @@ files:
470
389
  - lib/puppet/file_serving/mount/modules.rb
471
390
  - lib/puppet/file_serving/mount/pluginfacts.rb
472
391
  - lib/puppet/file_serving/mount/plugins.rb
392
+ - lib/puppet/file_serving/mount/scripts.rb
473
393
  - lib/puppet/file_serving/mount/tasks.rb
474
394
  - lib/puppet/file_serving/terminus_helper.rb
475
395
  - lib/puppet/file_serving/terminus_selector.rb
@@ -1393,8 +1313,16 @@ files:
1393
1313
  - spec/fixtures/faulty_face/puppet/face/syntax.rb
1394
1314
  - spec/fixtures/hiera.yaml
1395
1315
  - spec/fixtures/integration/application/agent/cached_deferred_catalog.json
1316
+ - spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
1396
1317
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
1397
1318
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
1319
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
1320
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
1321
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
1322
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml
1323
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po
1324
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot
1325
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json
1398
1326
  - spec/fixtures/integration/node/environment/sitedir/00_a.pp
1399
1327
  - spec/fixtures/integration/node/environment/sitedir/01_b.pp
1400
1328
  - spec/fixtures/integration/node/environment/sitedir/03_empty.pp
@@ -1820,6 +1748,7 @@ files:
1820
1748
  - spec/integration/indirector/facts/facter_spec.rb
1821
1749
  - spec/integration/indirector/file_content/file_server_spec.rb
1822
1750
  - spec/integration/indirector/file_metadata/file_server_spec.rb
1751
+ - spec/integration/l10n/compiler_spec.rb
1823
1752
  - spec/integration/network/formats_spec.rb
1824
1753
  - spec/integration/network/http/api/indirected_routes_spec.rb
1825
1754
  - spec/integration/network/http_pool_spec.rb
@@ -1915,6 +1844,7 @@ files:
1915
1844
  - spec/shared_contexts/checksum.rb
1916
1845
  - spec/shared_contexts/digests.rb
1917
1846
  - spec/shared_contexts/https.rb
1847
+ - spec/shared_contexts/l10n.rb
1918
1848
  - spec/shared_contexts/provider.rb
1919
1849
  - spec/shared_contexts/types_setup.rb
1920
1850
  - spec/shared_examples/rhel_package_provider.rb
@@ -1988,6 +1918,7 @@ files:
1988
1918
  - spec/unit/file_serving/mount/modules_spec.rb
1989
1919
  - spec/unit/file_serving/mount/pluginfacts_spec.rb
1990
1920
  - spec/unit/file_serving/mount/plugins_spec.rb
1921
+ - spec/unit/file_serving/mount/scripts_spec.rb
1991
1922
  - spec/unit/file_serving/mount/tasks_spec.rb
1992
1923
  - spec/unit/file_serving/mount_spec.rb
1993
1924
  - spec/unit/file_serving/terminus_helper_spec.rb
@@ -2157,7 +2088,6 @@ files:
2157
2088
  - spec/unit/indirector/resource/ral_spec.rb
2158
2089
  - spec/unit/indirector/resource/store_configs_spec.rb
2159
2090
  - spec/unit/indirector/rest_spec.rb
2160
- - spec/unit/indirector/store_configs_spec.rb
2161
2091
  - spec/unit/indirector/terminus_spec.rb
2162
2092
  - spec/unit/indirector/yaml_spec.rb
2163
2093
  - spec/unit/indirector_spec.rb
@@ -2639,8 +2569,16 @@ test_files:
2639
2569
  - spec/fixtures/faulty_face/puppet/face/syntax.rb
2640
2570
  - spec/fixtures/hiera.yaml
2641
2571
  - spec/fixtures/integration/application/agent/cached_deferred_catalog.json
2572
+ - spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
2642
2573
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
2643
2574
  - spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
2575
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
2576
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
2577
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
2578
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml
2579
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po
2580
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot
2581
+ - spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json
2644
2582
  - spec/fixtures/integration/node/environment/sitedir/00_a.pp
2645
2583
  - spec/fixtures/integration/node/environment/sitedir/01_b.pp
2646
2584
  - spec/fixtures/integration/node/environment/sitedir/03_empty.pp
@@ -3066,6 +3004,7 @@ test_files:
3066
3004
  - spec/integration/indirector/facts/facter_spec.rb
3067
3005
  - spec/integration/indirector/file_content/file_server_spec.rb
3068
3006
  - spec/integration/indirector/file_metadata/file_server_spec.rb
3007
+ - spec/integration/l10n/compiler_spec.rb
3069
3008
  - spec/integration/network/formats_spec.rb
3070
3009
  - spec/integration/network/http/api/indirected_routes_spec.rb
3071
3010
  - spec/integration/network/http_pool_spec.rb
@@ -3161,6 +3100,7 @@ test_files:
3161
3100
  - spec/shared_contexts/checksum.rb
3162
3101
  - spec/shared_contexts/digests.rb
3163
3102
  - spec/shared_contexts/https.rb
3103
+ - spec/shared_contexts/l10n.rb
3164
3104
  - spec/shared_contexts/provider.rb
3165
3105
  - spec/shared_contexts/types_setup.rb
3166
3106
  - spec/shared_examples/rhel_package_provider.rb
@@ -3234,6 +3174,7 @@ test_files:
3234
3174
  - spec/unit/file_serving/mount/modules_spec.rb
3235
3175
  - spec/unit/file_serving/mount/pluginfacts_spec.rb
3236
3176
  - spec/unit/file_serving/mount/plugins_spec.rb
3177
+ - spec/unit/file_serving/mount/scripts_spec.rb
3237
3178
  - spec/unit/file_serving/mount/tasks_spec.rb
3238
3179
  - spec/unit/file_serving/mount_spec.rb
3239
3180
  - spec/unit/file_serving/terminus_helper_spec.rb
@@ -3403,7 +3344,6 @@ test_files:
3403
3344
  - spec/unit/indirector/resource/ral_spec.rb
3404
3345
  - spec/unit/indirector/resource/store_configs_spec.rb
3405
3346
  - spec/unit/indirector/rest_spec.rb
3406
- - spec/unit/indirector/store_configs_spec.rb
3407
3347
  - spec/unit/indirector/terminus_spec.rb
3408
3348
  - spec/unit/indirector/yaml_spec.rb
3409
3349
  - spec/unit/indirector_spec.rb