puppet 7.15.0-universal-darwin → 7.18.0-universal-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +75 -14
- data/ext/systemd/puppet.service +1 -1
- data/lib/puppet/agent.rb +47 -11
- data/lib/puppet/application/agent.rb +3 -13
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/configurer.rb +1 -1
- data/lib/puppet/defaults.rb +11 -1
- data/lib/puppet/http/client.rb +22 -2
- data/lib/puppet/info_service/task_information_service.rb +1 -1
- data/lib/puppet/module/task.rb +5 -1
- data/lib/puppet/parameter.rb +19 -4
- data/lib/puppet/pops/evaluator/deferred_resolver.rb +46 -6
- data/lib/puppet/pops/functions/dispatcher.rb +10 -6
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +7 -6
- data/lib/puppet/pops/types/type_mismatch_describer.rb +22 -1
- data/lib/puppet/provider/package/puppetserver_gem.rb +7 -16
- data/lib/puppet/provider/package/yum.rb +8 -3
- data/lib/puppet/provider/user/directoryservice.rb +15 -8
- data/lib/puppet/ssl/ssl_provider.rb +75 -19
- data/lib/puppet/ssl/state_machine.rb +13 -17
- data/lib/puppet/transaction.rb +22 -0
- data/lib/puppet/type/user.rb +3 -0
- data/lib/puppet/type.rb +20 -3
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet.rb +1 -14
- data/man/man5/puppet.conf.5 +11 -3
- data/man/man8/puppet-agent.8 +2 -2
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-ssl.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/application/agent_spec.rb +157 -0
- data/spec/integration/application/apply_spec.rb +74 -0
- data/spec/integration/http/client_spec.rb +51 -4
- data/spec/lib/puppet_spec/https.rb +1 -1
- data/spec/lib/puppet_spec/puppetserver.rb +39 -2
- data/spec/unit/agent_spec.rb +28 -2
- data/spec/unit/application/agent_spec.rb +26 -16
- data/spec/unit/daemon_spec.rb +2 -11
- data/spec/unit/http/client_spec.rb +18 -0
- data/spec/unit/info_service_spec.rb +11 -3
- data/spec/unit/pops/evaluator/deferred_resolver_spec.rb +26 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +1 -1
- data/spec/unit/pops/types/type_mismatch_describer_spec.rb +167 -1
- data/spec/unit/provider/package/puppetserver_gem_spec.rb +2 -2
- data/spec/unit/provider/user/directoryservice_spec.rb +1 -1
- data/spec/unit/ssl/ssl_provider_spec.rb +75 -1
- data/spec/unit/ssl/state_machine_spec.rb +1 -0
- data/spec/unit/task_spec.rb +56 -13
- data/tasks/generate_cert_fixtures.rake +5 -4
- metadata +2 -2
data/spec/unit/task_spec.rb
CHANGED
@@ -24,6 +24,7 @@ describe Puppet::Module::Task do
|
|
24
24
|
it "constructs tasks as expected when every task has a metadata file with the same name (besides extension)" do
|
25
25
|
task_files = %w{task1.json task1 task2.json task2.exe task3.json task3.sh}.map { |bn| "#{tasks_path}/#{bn}" }
|
26
26
|
expect(Dir).to receive(:glob).with(tasks_glob).and_return(task_files)
|
27
|
+
task_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
27
28
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
28
29
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({})
|
29
30
|
|
@@ -52,6 +53,7 @@ describe Puppet::Module::Task do
|
|
52
53
|
it "constructs tasks as expected when some tasks don't have a metadata file" do
|
53
54
|
task_files = %w{task1 task2.exe task3.json task3.sh}.map { |bn| "#{tasks_path}/#{bn}" }
|
54
55
|
expect(Dir).to receive(:glob).with(tasks_glob).and_return(task_files)
|
56
|
+
task_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
55
57
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({})
|
56
58
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
57
59
|
|
@@ -66,6 +68,7 @@ describe Puppet::Module::Task do
|
|
66
68
|
it "constructs a task as expected when a task has implementations" do
|
67
69
|
task_files = %w{task1.elf task1.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
68
70
|
expect(Dir).to receive(:glob).with(tasks_glob).and_return(task_files)
|
71
|
+
task_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
69
72
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
70
73
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({'implementations' => [{"name" => "task1.sh"}]})
|
71
74
|
|
@@ -78,6 +81,7 @@ describe Puppet::Module::Task do
|
|
78
81
|
it "constructs a task as expected when task metadata declares additional files" do
|
79
82
|
task_files = %w{task1.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
80
83
|
expect(Dir).to receive(:glob).with(tasks_glob).and_return(task_files)
|
84
|
+
task_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
81
85
|
expect(Puppet::Module::Task).to receive(:find_extra_files).and_return([{'name' => 'mymod/lib/file0.elf', 'path' => "/path/to/file0.elf"}])
|
82
86
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
83
87
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({'files' => ["mymod/lib/file0.elf"]})
|
@@ -91,6 +95,7 @@ describe Puppet::Module::Task do
|
|
91
95
|
it "constructs a task as expected when a task implementation declares additional files" do
|
92
96
|
task_files = %w{task1.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
93
97
|
expect(Dir).to receive(:glob).with(tasks_glob).and_return(task_files)
|
98
|
+
task_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
94
99
|
expect(Puppet::Module::Task).to receive(:find_extra_files).and_return([{'name' => 'mymod/lib/file0.elf', 'path' => "/path/to/file0.elf"}])
|
95
100
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
96
101
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({'implementations' => [{"name" => "task1.sh", "files" => ["mymod/lib/file0.elf"]}]})
|
@@ -104,6 +109,7 @@ describe Puppet::Module::Task do
|
|
104
109
|
it "constructs a task as expected when task metadata and a task implementation both declare additional files" do
|
105
110
|
task_files = %w{task1.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
106
111
|
expect(Dir).to receive(:glob).with(tasks_glob).and_return(task_files)
|
112
|
+
task_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
107
113
|
expect(Puppet::Module::Task).to receive(:find_extra_files).and_return([
|
108
114
|
{'name' => 'mymod/lib/file0.elf', 'path' => "/path/to/file0.elf"},
|
109
115
|
{'name' => 'yourmod/files/file1.txt', 'path' => "/other/path/to/file1.txt"}
|
@@ -124,6 +130,7 @@ describe Puppet::Module::Task do
|
|
124
130
|
it "constructs a task as expected when a task has files" do
|
125
131
|
og_files = %w{task1.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
126
132
|
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
133
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
127
134
|
expect(File).to receive(:exist?).with(any_args).and_return(true).at_least(:once)
|
128
135
|
|
129
136
|
expect(Puppet::Module).to receive(:find).with(othermod.name, "production").and_return(othermod).at_least(:once)
|
@@ -139,6 +146,7 @@ describe Puppet::Module::Task do
|
|
139
146
|
it "fails to load a task if its metadata specifies a non-existent file" do
|
140
147
|
og_files = %w{task1.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
141
148
|
allow(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
149
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
142
150
|
allow(File).to receive(:exist?).with(any_args).and_return(true)
|
143
151
|
|
144
152
|
expect(Puppet::Module).to receive(:find).with(othermod.name, "production").and_return(nil).at_least(:once)
|
@@ -149,7 +157,9 @@ describe Puppet::Module::Task do
|
|
149
157
|
end
|
150
158
|
|
151
159
|
it "finds files whose names (besides extensions) are valid task names" do
|
152
|
-
|
160
|
+
og_files = %w{task task_1 xx_t_a_s_k_2_xx}.map { |bn| "#{tasks_path}/#{bn}" }
|
161
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
162
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
153
163
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
154
164
|
|
155
165
|
expect(tasks.count).to eq(3)
|
@@ -157,7 +167,9 @@ describe Puppet::Module::Task do
|
|
157
167
|
end
|
158
168
|
|
159
169
|
it "ignores files that have names (besides extensions) that are not valid task names" do
|
160
|
-
|
170
|
+
og_files = %w{.nottask.exe .wat !runme _task 2task2furious def_a_task_PSYCH Fake_task not-a-task realtask}.map { |bn| "#{tasks_path}/#{bn}" }
|
171
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
172
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
161
173
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
162
174
|
|
163
175
|
expect(tasks.count).to eq(1)
|
@@ -165,13 +177,24 @@ describe Puppet::Module::Task do
|
|
165
177
|
end
|
166
178
|
|
167
179
|
it "ignores files that have names ending in .conf and .md" do
|
168
|
-
|
180
|
+
og_files = %w{ginuwine_task task.conf readme.md other_task.md}.map { |bn| "#{tasks_path}/#{bn}" }
|
181
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
182
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
169
183
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
170
184
|
|
171
185
|
expect(tasks.count).to eq(1)
|
172
186
|
expect(tasks.map{|t| t.name}).to eq(%w{mymod::ginuwine_task})
|
173
187
|
end
|
174
188
|
|
189
|
+
it "ignores files which are not regular files" do
|
190
|
+
og_files = %w{foo}.map { |bn| "#{tasks_path}/#{bn}" }
|
191
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
192
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(false) }
|
193
|
+
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
194
|
+
|
195
|
+
expect(tasks.count).to eq(0)
|
196
|
+
end
|
197
|
+
|
175
198
|
it "gives the 'init' task a name that is just the module's name" do
|
176
199
|
expect(Puppet::Module::Task.new(mymod, 'init', ["#{tasks_path}/init.sh"]).name).to eq('mymod')
|
177
200
|
end
|
@@ -179,7 +202,9 @@ describe Puppet::Module::Task do
|
|
179
202
|
describe :metadata do
|
180
203
|
it "loads metadata for a task" do
|
181
204
|
metadata = {'desciption': 'some info'}
|
182
|
-
|
205
|
+
og_files = %w{task1.exe task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
206
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
207
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
183
208
|
allow(Puppet::Module::Task).to receive(:read_metadata).and_return(metadata)
|
184
209
|
|
185
210
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
@@ -189,7 +214,9 @@ describe Puppet::Module::Task do
|
|
189
214
|
end
|
190
215
|
|
191
216
|
it 'returns nil for metadata if no file is present' do
|
192
|
-
|
217
|
+
og_files = %w{task1.exe}.map { |bn| "#{tasks_path}/#{bn}" }
|
218
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
219
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
193
220
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
194
221
|
|
195
222
|
expect(tasks.count).to eq(1)
|
@@ -212,7 +239,9 @@ describe Puppet::Module::Task do
|
|
212
239
|
|
213
240
|
describe :validate do
|
214
241
|
it "validates when there is no metadata" do
|
215
|
-
|
242
|
+
og_files = %w{task1.exe}.map { |bn| "#{tasks_path}/#{bn}" }
|
243
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
244
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
216
245
|
|
217
246
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
218
247
|
|
@@ -223,7 +252,9 @@ describe Puppet::Module::Task do
|
|
223
252
|
it "validates when an implementation isn't used" do
|
224
253
|
metadata = {'desciption' => 'some info',
|
225
254
|
'implementations' => [ {"name" => "task1.exe"}, ] }
|
226
|
-
|
255
|
+
og_files = %w{task1.exe task1.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
256
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
257
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
227
258
|
allow(Puppet::Module::Task).to receive(:read_metadata).and_return(metadata)
|
228
259
|
|
229
260
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
@@ -235,7 +266,9 @@ describe Puppet::Module::Task do
|
|
235
266
|
it "validates when an implementation is another task" do
|
236
267
|
metadata = {'desciption' => 'some info',
|
237
268
|
'implementations' => [ {"name" => "task2.sh"}, ] }
|
238
|
-
|
269
|
+
og_files = %w{task1.exe task2.sh task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
270
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
271
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
239
272
|
allow(Puppet::Module::Task).to receive(:read_metadata).and_return(metadata)
|
240
273
|
|
241
274
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
@@ -245,7 +278,9 @@ describe Puppet::Module::Task do
|
|
245
278
|
end
|
246
279
|
|
247
280
|
it "fails validation when there is no metadata and multiple task files" do
|
248
|
-
|
281
|
+
og_files = %w{task1.elf task1.exe task1.json task2.ps1 task2.sh}.map { |bn| "#{tasks_path}/#{bn}" }
|
282
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
283
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
249
284
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
250
285
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({})
|
251
286
|
|
@@ -255,7 +290,9 @@ describe Puppet::Module::Task do
|
|
255
290
|
end
|
256
291
|
|
257
292
|
it "fails validation when an implementation references a non-existant file" do
|
258
|
-
|
293
|
+
og_files = %w{task1.elf task1.exe task1.json}.map { |bn| "#{tasks_path}/#{bn}" }
|
294
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
295
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
259
296
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
260
297
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({'implementations' => [ { 'name' => 'task1.sh' } ] })
|
261
298
|
|
@@ -265,7 +302,9 @@ describe Puppet::Module::Task do
|
|
265
302
|
end
|
266
303
|
|
267
304
|
it 'fails validation when there is metadata but no executable' do
|
268
|
-
|
305
|
+
og_files = %w{task1.json task2.sh}.map { |bn| "#{tasks_path}/#{bn}" }
|
306
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
307
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
269
308
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
270
309
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({})
|
271
310
|
|
@@ -273,7 +312,9 @@ describe Puppet::Module::Task do
|
|
273
312
|
end
|
274
313
|
|
275
314
|
it 'fails validation when the implementations are not an array' do
|
276
|
-
|
315
|
+
og_files = %w{task1.json task2.sh}.map { |bn| "#{tasks_path}/#{bn}" }
|
316
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
317
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
277
318
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
278
319
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({"implemenations" => {}})
|
279
320
|
|
@@ -281,7 +322,9 @@ describe Puppet::Module::Task do
|
|
281
322
|
end
|
282
323
|
|
283
324
|
it 'fails validation when the implementation is json' do
|
284
|
-
|
325
|
+
og_files = %w{task1.json task1.sh}.map { |bn| "#{tasks_path}/#{bn}" }
|
326
|
+
expect(Dir).to receive(:glob).with(tasks_glob).and_return(og_files)
|
327
|
+
og_files.each { |f| expect(File).to receive(:file?).with(f).and_return(true) }
|
285
328
|
tasks = Puppet::Module::Task.tasks_in_module(mymod)
|
286
329
|
allow_any_instance_of(Puppet::Module::Task).to receive(:metadata).and_return({'implementations' => [ { 'name' => 'task1.json' } ] })
|
287
330
|
|
@@ -37,14 +37,15 @@ task(:gen_cert_fixtures) do
|
|
37
37
|
# | |
|
38
38
|
# signed.pem | +- /CN=signed
|
39
39
|
# revoked.pem | +- /CN=revoked
|
40
|
-
# 127.0.0.1.pem | +- /CN=127.0.0.1 (with dns alt names)
|
41
40
|
# tampered-cert.pem | +- /CN=signed (with different public key)
|
42
41
|
# ec.pem | +- /CN=ec (with EC private key)
|
43
42
|
# oid.pem | +- /CN=oid (with custom oid)
|
44
43
|
# |
|
45
|
-
#
|
46
|
-
# |
|
47
|
-
#
|
44
|
+
# 127.0.0.1.pem +- /CN=127.0.0.1 (with dns alt names)
|
45
|
+
# |
|
46
|
+
# intermediate-agent.pem +- /CN=Test CA Agent Subauthority
|
47
|
+
# | |
|
48
|
+
# pluto.pem | +- /CN=pluto
|
48
49
|
# |
|
49
50
|
# bad-int-basic-constraints.pem +- /CN=Test CA Subauthority (bad isCA constraint)
|
50
51
|
#
|
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.
|
4
|
+
version: 7.18.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: 2022-
|
11
|
+
date: 2022-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|