puppet 5.5.16-universal-darwin → 5.5.17-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 (108) hide show
  1. checksums.yaml +4 -4
  2. data/CODEOWNERS +9 -9
  3. data/Gemfile.lock +18 -18
  4. data/ext/project_data.yaml +2 -2
  5. data/install.rb +3 -21
  6. data/lib/puppet/application/agent.rb +12 -0
  7. data/lib/puppet/application/device.rb +4 -4
  8. data/lib/puppet/application/resource.rb +4 -4
  9. data/lib/puppet/defaults.rb +4 -0
  10. data/lib/puppet/face/config.rb +10 -48
  11. data/lib/puppet/face/facts.rb +1 -1
  12. data/lib/puppet/face/plugin.rb +9 -2
  13. data/lib/puppet/module_tool/tar/mini.rb +11 -1
  14. data/lib/puppet/network/http/factory.rb +1 -11
  15. data/lib/puppet/parameter.rb +8 -0
  16. data/lib/puppet/provider/file/posix.rb +5 -0
  17. data/lib/puppet/provider/nameservice.rb +10 -3
  18. data/lib/puppet/provider/package/dnf.rb +1 -1
  19. data/lib/puppet/provider/package/rpm.rb +51 -13
  20. data/lib/puppet/provider/package/yum.rb +8 -4
  21. data/lib/puppet/provider/service/launchd.rb +20 -5
  22. data/lib/puppet/provider/service/systemd.rb +4 -9
  23. data/lib/puppet/provider/service/windows.rb +8 -0
  24. data/lib/puppet/provider/user/pw.rb +12 -3
  25. data/lib/puppet/provider/user/user_role_add.rb +4 -0
  26. data/lib/puppet/provider/user/useradd.rb +23 -7
  27. data/lib/puppet/resource.rb +17 -0
  28. data/lib/puppet/settings.rb +40 -0
  29. data/lib/puppet/type.rb +7 -0
  30. data/lib/puppet/type/exec.rb +14 -6
  31. data/lib/puppet/type/package.rb +10 -0
  32. data/lib/puppet/type/service.rb +7 -2
  33. data/lib/puppet/type/user.rb +1 -15
  34. data/lib/puppet/type/yumrepo.rb +3 -7
  35. data/lib/puppet/util/execution.rb +4 -3
  36. data/lib/puppet/util/http_proxy.rb +16 -2
  37. data/lib/puppet/util/selinux.rb +5 -1
  38. data/lib/puppet/util/windows/security.rb +2 -0
  39. data/lib/puppet/util/windows/service.rb +149 -4
  40. data/lib/puppet/util/windows/sid.rb +1 -0
  41. data/lib/puppet/version.rb +1 -1
  42. data/locales/puppet.pot +189 -193
  43. data/man/man5/puppet.conf.5 +10 -2
  44. data/man/man8/puppet-agent.8 +1 -1
  45. data/man/man8/puppet-apply.8 +1 -1
  46. data/man/man8/puppet-ca.8 +1 -1
  47. data/man/man8/puppet-catalog.8 +1 -1
  48. data/man/man8/puppet-cert.8 +1 -1
  49. data/man/man8/puppet-certificate.8 +1 -1
  50. data/man/man8/puppet-certificate_request.8 +1 -1
  51. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  52. data/man/man8/puppet-config.8 +1 -1
  53. data/man/man8/puppet-describe.8 +1 -1
  54. data/man/man8/puppet-device.8 +1 -1
  55. data/man/man8/puppet-doc.8 +1 -1
  56. data/man/man8/puppet-epp.8 +1 -1
  57. data/man/man8/puppet-facts.8 +1 -1
  58. data/man/man8/puppet-filebucket.8 +1 -1
  59. data/man/man8/puppet-generate.8 +1 -1
  60. data/man/man8/puppet-help.8 +1 -1
  61. data/man/man8/puppet-key.8 +1 -1
  62. data/man/man8/puppet-lookup.8 +1 -1
  63. data/man/man8/puppet-man.8 +1 -1
  64. data/man/man8/puppet-master.8 +1 -1
  65. data/man/man8/puppet-module.8 +1 -1
  66. data/man/man8/puppet-node.8 +1 -1
  67. data/man/man8/puppet-parser.8 +1 -1
  68. data/man/man8/puppet-plugin.8 +1 -1
  69. data/man/man8/puppet-report.8 +1 -1
  70. data/man/man8/puppet-resource.8 +1 -1
  71. data/man/man8/puppet-script.8 +1 -1
  72. data/man/man8/puppet-status.8 +1 -1
  73. data/man/man8/puppet.8 +2 -2
  74. data/spec/integration/provider/service/systemd_spec.rb +8 -5
  75. data/spec/integration/type/file_spec.rb +28 -0
  76. data/spec/integration/util/execution_spec.rb +27 -0
  77. data/spec/unit/application/agent_spec.rb +18 -0
  78. data/spec/unit/application/device_spec.rb +1 -1
  79. data/spec/unit/face/facts_spec.rb +9 -0
  80. data/spec/unit/face/plugin_spec.rb +8 -0
  81. data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
  82. data/spec/unit/network/http/api/indirected_routes_spec.rb +26 -10
  83. data/spec/unit/network/http/factory_spec.rb +27 -5
  84. data/spec/unit/pops/validator/validator_spec.rb +7 -0
  85. data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
  86. data/spec/unit/provider/package/dnf_spec.rb +7 -0
  87. data/spec/unit/provider/package/rpm_spec.rb +150 -16
  88. data/spec/unit/provider/package/yum_spec.rb +7 -0
  89. data/spec/unit/provider/service/launchd_spec.rb +28 -0
  90. data/spec/unit/provider/service/windows_spec.rb +20 -0
  91. data/spec/unit/provider/user/pw_spec.rb +37 -0
  92. data/spec/unit/provider/user/useradd_spec.rb +42 -0
  93. data/spec/unit/resource_spec.rb +26 -1
  94. data/spec/unit/transaction_spec.rb +18 -0
  95. data/spec/unit/type/exec_spec.rb +9 -0
  96. data/spec/unit/type/file/source_spec.rb +4 -4
  97. data/spec/unit/type/schedule_spec.rb +3 -1
  98. data/spec/unit/type/service_spec.rb +16 -0
  99. data/spec/unit/type/user_spec.rb +13 -13
  100. data/spec/unit/type/yumrepo_spec.rb +30 -0
  101. data/spec/unit/type_spec.rb +40 -0
  102. data/spec/unit/util/http_proxy_spec.rb +24 -1
  103. data/spec/unit/util/log_spec.rb +27 -1
  104. data/spec/unit/util/windows/service_spec.rb +9 -0
  105. metadata +3 -7
  106. data/ext/windows/eventlog/Rakefile +0 -32
  107. data/ext/windows/eventlog/puppetres.dll +0 -0
  108. data/ext/windows/eventlog/puppetres.mc +0 -18
@@ -735,6 +735,46 @@ describe Puppet::Type, :unless => Puppet.features.microsoft_windows? do
735
735
  end
736
736
  end
737
737
 
738
+ describe "#set_sensitive_parameters" do
739
+ let(:sensitive_type) do
740
+ Puppet::Type.newtype(:sensitive_test) do
741
+ newparam(:name) { isnamevar }
742
+ newproperty(:secret) do
743
+ newvalues(/.*/)
744
+ sensitive true
745
+ end
746
+ newproperty(:transparency) do
747
+ newvalues(/.*/)
748
+ sensitive false
749
+ end
750
+ newproperty(:things) { newvalues(/.*/) }
751
+ end
752
+ end
753
+
754
+ it "should mark properties as sensitive" do
755
+ resource = sensitive_type.new(:name => 'foo', :secret => 'uber classified')
756
+ expect(resource.parameters[:secret].sensitive).to be true
757
+ end
758
+
759
+ it "should not have a sensitive flag when not set" do
760
+ resource = sensitive_type.new(:name => 'foo', :things => '1337')
761
+ expect(resource.parameters[:things].sensitive).to be_nil
762
+ end
763
+
764
+ it "should define things as not sensitive" do
765
+ resource = sensitive_type.new(:name => 'foo', :transparency => 'public knowledge')
766
+ expect(resource.parameters[:transparency].sensitive).to be false
767
+ end
768
+
769
+ it "should honor when sensitivity is set in a manifest" do
770
+ resource = sensitive_type.new(:name => 'foo',
771
+ :transparency => Puppet::Pops::Types::PSensitiveType::Sensitive.new('top secret'),
772
+ :sensitive_parameters => [:transparency]
773
+ )
774
+ expect(resource.parameters[:transparency].sensitive).to be true
775
+ end
776
+ end
777
+
738
778
  describe "when #finish is called on a type" do
739
779
  let(:post_hook_type) do
740
780
  Puppet::Type.newtype(:finish_test) do
@@ -129,9 +129,32 @@ describe Puppet::Util::HttpProxy do
129
129
 
130
130
  end
131
131
 
132
+ describe ".no_proxy" do
133
+ no_proxy = '127.0.0.1, localhost'
134
+ it "should use a no_proxy list if set in environment" do
135
+ Puppet::Util.withenv('NO_PROXY' => no_proxy) do
136
+ expect(subject.no_proxy).to eq(no_proxy)
137
+ end
138
+ end
139
+
140
+ it "should use a no_proxy list if set in config" do
141
+ Puppet.settings[:no_proxy] = no_proxy
142
+ expect(subject.no_proxy).to eq(no_proxy)
143
+ end
144
+
145
+ it "should use environment variable before puppet settings" do
146
+ no_proxy_puppet_setting = '10.0.0.1, localhost'
147
+ Puppet::Util.withenv('NO_PROXY' => no_proxy) do
148
+ Puppet.settings[:no_proxy] = no_proxy_puppet_setting
149
+ expect(subject.no_proxy).to eq(no_proxy)
150
+ end
151
+ end
152
+ end
153
+
132
154
  describe ".no_proxy?" do
133
155
  no_proxy = '127.0.0.1, localhost, mydomain.com, *.otherdomain.com, oddport.com:8080, *.otheroddport.com:8080, .anotherdomain.com, .anotheroddport.com:8080'
134
- it "should return false if no_proxy does not exist in env" do
156
+
157
+ it "should return false if no_proxy does not exist in environment or puppet settings" do
135
158
  Puppet::Util.withenv('no_proxy' => nil) do
136
159
  dest = 'https://puppetlabs.com'
137
160
  expect(subject.no_proxy?(dest)).to be false
@@ -178,7 +178,7 @@ describe Puppet::Util::Log do
178
178
  expect(logs.collect(&:message)).to include("Inner block", "Outer block")
179
179
  end
180
180
 
181
- it 'includes backtrace for RuntimeError in log message when trace is enabled' do
181
+ it 'includes backtrace for RuntimeError in log message when trace option is passed' do
182
182
  logs = []
183
183
  destination = Puppet::Test::LogCollector.new(logs)
184
184
 
@@ -196,6 +196,32 @@ describe Puppet::Util::Log do
196
196
  expect(log.backtrace).to be_nil
197
197
  end
198
198
 
199
+ context "global options" do
200
+ around :each do |example|
201
+ Puppet[:trace] = true
202
+ example.run
203
+ Puppet[:trace] = false
204
+ end
205
+
206
+ it 'includes backtrace for RuntimeError in log message when trace is enabled globally' do
207
+ logs = []
208
+ destination = Puppet::Test::LogCollector.new(logs)
209
+
210
+ Puppet::Util::Log.newdestination(destination)
211
+ Puppet::Util::Log.with_destination(destination) do
212
+ begin
213
+ raise RuntimeError, 'Oops'
214
+ rescue RuntimeError => e
215
+ Puppet.log_exception(e, :default)
216
+ end
217
+ end
218
+ expect(logs.size).to eq(1)
219
+ log = logs[0]
220
+ expect(log.message).to match('/log_spec.rb')
221
+ expect(log.backtrace).to be_nil
222
+ end
223
+ end
224
+
199
225
  it 'excludes backtrace for RuntimeError in log message when trace is disabled' do
200
226
  logs = []
201
227
  destination = Puppet::Test::LogCollector.new(logs)
@@ -41,6 +41,10 @@ describe "Puppet::Util::Windows::Service", :if => Puppet.features.microsoft_wind
41
41
  expect(subject::QUERY_SERVICE_CONFIGW).to receive(:new).and_return(query_return)
42
42
  end
43
43
 
44
+ def expect_successful_config_query2_and_return(param, query_return)
45
+ expect(param).to receive(:new).and_return(query_return)
46
+ end
47
+
44
48
  let(:subject) { Puppet::Util::Windows::Service }
45
49
  let(:pointer) { double() }
46
50
  let(:mock_service_name) { double() }
@@ -50,7 +54,9 @@ describe "Puppet::Util::Windows::Service", :if => Puppet.features.microsoft_wind
50
54
  before do
51
55
  allow(subject).to receive(:QueryServiceStatusEx).and_return(1)
52
56
  allow(subject).to receive(:QueryServiceConfigW).and_return(1)
57
+ allow(subject).to receive(:QueryServiceConfig2W).and_return(1)
53
58
  allow(subject).to receive(:ChangeServiceConfigW).and_return(1)
59
+ allow(subject).to receive(:ChangeServiceConfig2W).and_return(1)
54
60
  allow(subject).to receive(:OpenSCManagerW).and_return(scm)
55
61
  allow(subject).to receive(:OpenServiceW).and_return(service)
56
62
  allow(subject).to receive(:CloseServiceHandle)
@@ -576,6 +582,9 @@ describe "Puppet::Util::Windows::Service", :if => Puppet.features.microsoft_wind
576
582
  }.each do |start_type_name, start_type|
577
583
  it "queries the service and returns the service start type #{start_type_name}" do
578
584
  expect_successful_config_query_and_return({:dwStartType => start_type})
585
+ if start_type_name == :SERVICE_AUTO_START
586
+ expect_successful_config_query2_and_return(subject::SERVICE_DELAYED_AUTO_START_INFO, {:fDelayedAutostart => 0})
587
+ end
579
588
  expect(subject.service_start_type(mock_service_name)).to eq(start_type_name)
580
589
  end
581
590
  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: 5.5.16
4
+ version: 5.5.17
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: 2019-07-11 00:00:00.000000000 Z
11
+ date: 2019-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -253,9 +253,6 @@ files:
253
253
  - ext/suse/server.init
254
254
  - ext/systemd/puppet.service
255
255
  - ext/upload_facts.rb
256
- - ext/windows/eventlog/Rakefile
257
- - ext/windows/eventlog/puppetres.dll
258
- - ext/windows/eventlog/puppetres.mc
259
256
  - ext/windows/puppet_interactive.bat
260
257
  - ext/windows/puppet_shell.bat
261
258
  - ext/windows/run_puppet_interactive.bat
@@ -2718,8 +2715,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2718
2715
  - !ruby/object:Gem::Version
2719
2716
  version: 1.3.1
2720
2717
  requirements: []
2721
- rubyforge_project: puppet
2722
- rubygems_version: 2.7.7
2718
+ rubygems_version: 3.0.4
2723
2719
  signing_key:
2724
2720
  specification_version: 4
2725
2721
  summary: Puppet, an automated configuration management tool
@@ -1,32 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'fileutils'
4
- require 'rbconfig'
5
-
6
- BASENAME = "puppetres"
7
-
8
- task :default do
9
- sh 'rake -T'
10
- end
11
-
12
- desc 'Build puppet eventlog message dll'
13
- task :dist => ['out', "#{BASENAME}.dll"]
14
-
15
- directory 'out'
16
-
17
- rule '.rc' => '.mc' do |t|
18
- sh "mc -b -r out -h out #{t.source}"
19
- end
20
-
21
- rule '.res' => '.rc' do |t|
22
- sh "rc -nologo -r -fo out/#{t.name} out/#{t.source}"
23
- end
24
-
25
- rule '.dll' => '.res' do |t|
26
- sh "link -nologo -dll -noentry -machine:x86 -out:out/#{t.name} out/#{t.source}"
27
- end
28
-
29
- desc 'Delete generated files'
30
- task :clean do
31
- FileUtils.rm_rf('out')
32
- end
Binary file
@@ -1,18 +0,0 @@
1
- MessageId=0x1
2
- SymbolicName=PUPPET_INFO
3
- Language=English
4
- %1
5
- .
6
-
7
- MessageId=0x2
8
- SymbolicName=PUPPET_WARN
9
- Language=English
10
- %1
11
- .
12
-
13
- MessageId=0x3
14
- SymbolicName=PUPPET_ERROR
15
- Language=English
16
- %1
17
- .
18
-