puppet 7.27.0-universal-darwin → 7.28.0-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +27 -26
  3. data/Rakefile +0 -27
  4. data/examples/enc/regexp_nodes/regexp_nodes.rb +1 -1
  5. data/lib/puppet/configurer.rb +1 -1
  6. data/lib/puppet/file_system/file_impl.rb +1 -1
  7. data/lib/puppet/file_system/posix.rb +1 -1
  8. data/lib/puppet/functions/versioncmp.rb +1 -1
  9. data/lib/puppet/http/service/compiler.rb +4 -0
  10. data/lib/puppet/indirector/catalog/compiler.rb +12 -4
  11. data/lib/puppet/indirector/catalog/rest.rb +8 -0
  12. data/lib/puppet/interface/action.rb +4 -2
  13. data/lib/puppet/interface/action_builder.rb +4 -9
  14. data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +1 -1
  15. data/lib/puppet/pops/loader/ruby_function_instantiator.rb +1 -1
  16. data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +1 -1
  17. data/lib/puppet/provider/package/appdmg.rb +1 -1
  18. data/lib/puppet/provider/package/dnf.rb +1 -0
  19. data/lib/puppet/provider/package/dnfmodule.rb +1 -1
  20. data/lib/puppet/provider/package/windows/package.rb +2 -2
  21. data/lib/puppet/provider/package/yum.rb +1 -1
  22. data/lib/puppet/provider/service/init.rb +2 -5
  23. data/lib/puppet/provider/service/systemd.rb +4 -3
  24. data/lib/puppet/settings.rb +16 -2
  25. data/lib/puppet/ssl/ssl_context.rb +10 -15
  26. data/lib/puppet/type/component.rb +1 -1
  27. data/lib/puppet/type/exec.rb +15 -7
  28. data/lib/puppet/type/resources.rb +1 -0
  29. data/lib/puppet/util/command_line/trollop.rb +1 -1
  30. data/lib/puppet/util/execution.rb +2 -1
  31. data/lib/puppet/util/package/version/pip.rb +2 -2
  32. data/lib/puppet/version.rb +1 -1
  33. data/man/man5/puppet.conf.5 +2 -2
  34. data/man/man8/puppet-agent.8 +1 -1
  35. data/man/man8/puppet-apply.8 +1 -1
  36. data/man/man8/puppet-catalog.8 +1 -1
  37. data/man/man8/puppet-config.8 +1 -1
  38. data/man/man8/puppet-describe.8 +1 -1
  39. data/man/man8/puppet-device.8 +1 -1
  40. data/man/man8/puppet-doc.8 +1 -1
  41. data/man/man8/puppet-epp.8 +1 -1
  42. data/man/man8/puppet-facts.8 +1 -1
  43. data/man/man8/puppet-filebucket.8 +1 -1
  44. data/man/man8/puppet-generate.8 +1 -1
  45. data/man/man8/puppet-help.8 +1 -1
  46. data/man/man8/puppet-lookup.8 +1 -1
  47. data/man/man8/puppet-module.8 +1 -1
  48. data/man/man8/puppet-node.8 +1 -1
  49. data/man/man8/puppet-parser.8 +1 -1
  50. data/man/man8/puppet-plugin.8 +1 -1
  51. data/man/man8/puppet-report.8 +1 -1
  52. data/man/man8/puppet-resource.8 +1 -1
  53. data/man/man8/puppet-script.8 +1 -1
  54. data/man/man8/puppet-ssl.8 +1 -1
  55. data/man/man8/puppet.8 +2 -2
  56. data/spec/integration/application/agent_spec.rb +13 -0
  57. data/spec/lib/puppet_spec/puppetserver.rb +1 -0
  58. data/spec/unit/indirector/catalog/compiler_spec.rb +17 -0
  59. data/spec/unit/indirector/catalog/rest_spec.rb +17 -0
  60. data/spec/unit/provider/package/appdmg_spec.rb +1 -1
  61. data/spec/unit/provider/package/dnf_spec.rb +7 -0
  62. data/spec/unit/provider/package/dnfmodule_spec.rb +22 -2
  63. data/spec/unit/provider/service/systemd_spec.rb +8 -6
  64. data/spec/unit/type/exec_spec.rb +13 -0
  65. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c8e68ee599ed861726eab93a5c562c4b78b4ac8dedb858b463e42d0f227fc08
4
- data.tar.gz: 682f12641fdef56f5a9966bd9ceb3ef5c4040b8fbc78cb2047b95b6f1e9d4249
3
+ metadata.gz: 4ca69a6f361800e19a86c6b4a2178a6e039fbfc85ef05070b1e358b247993c8c
4
+ data.tar.gz: ed17551e5d149da2665c928587681b6f6477993c3c7b6c99f430620471009d50
5
5
  SHA512:
6
- metadata.gz: d06c4acb947c364b0d03acac6b8460633fa10f0003da26a46ab6c75885b2fc5a5449ef8e498763a21a025368ae4f21a0b5583f647220e683c4319bb0e1486ed4
7
- data.tar.gz: 5babca90f6a026d264cc36c681b5a7de11955801b52ca25f64185106c8997429546caa3c66a906a177c3ec32261e303ab382f6bcc35b545f37a0e32bc7089c51
6
+ metadata.gz: b6520363aa19cded7818197cf5663c5abb2316db12e086d1984c59a586f6817982823934dec29e35cd82cc49d4883fa3c8e0c939ed47daa157f11ce58c38741b
7
+ data.tar.gz: 8c1c009cb4d877d6b74104e89bd4aa040bab6afa063dba78babd6372d472d0b33726a1d8c4dff907b15aa26afe4c511bd6291e3c5e54a6b11098c27d4195103d
data/Gemfile.lock CHANGED
@@ -1,6 +1,6 @@
1
1
  GIT
2
2
  remote: https://github.com/puppetlabs/packaging
3
- revision: 8adf33f59cc443c311c5d5d70c6ba2084625ceea
3
+ revision: 6c91ebc40b07f2041aa39b21becde6a06684e1b9
4
4
  branch: 1.0.x
5
5
  specs:
6
6
  packaging (0)
@@ -15,7 +15,7 @@ GIT
15
15
  PATH
16
16
  remote: .
17
17
  specs:
18
- puppet (7.27.0)
18
+ puppet (7.28.0)
19
19
  CFPropertyList (~> 2.2)
20
20
  concurrent-ruby (~> 1.0)
21
21
  deep_merge (~> 1.0)
@@ -31,28 +31,28 @@ GEM
31
31
  remote: https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/
32
32
  specs:
33
33
  CFPropertyList (2.3.6)
34
- addressable (2.8.5)
34
+ addressable (2.8.6)
35
35
  public_suffix (>= 2.0.2, < 6.0)
36
36
  apt_stage_artifacts (0.11.0)
37
37
  docopt
38
38
  artifactory (3.0.15)
39
39
  ast (2.4.2)
40
- base64 (0.1.1)
40
+ base64 (0.2.0)
41
41
  coderay (1.1.3)
42
42
  concurrent-ruby (1.2.2)
43
43
  crack (0.4.5)
44
44
  rexml
45
- csv (3.2.7)
45
+ csv (3.2.8)
46
46
  declarative (0.0.20)
47
47
  deep_merge (1.2.2)
48
48
  diff-lcs (1.5.0)
49
49
  digest-crc (0.6.5)
50
50
  rake (>= 12.0.0, < 14.0.0)
51
51
  docopt (0.6.1)
52
- facter (4.5.0)
52
+ facter (4.5.1)
53
53
  hocon (~> 1.3)
54
54
  thor (>= 1.0.1, < 2.0)
55
- faraday (2.7.11)
55
+ faraday (2.8.1)
56
56
  base64
57
57
  faraday-net_http (>= 2.0, < 3.1)
58
58
  ruby2_keywords (>= 0.0.4)
@@ -66,7 +66,7 @@ GEM
66
66
  fast_gettext (~> 1.1.0)
67
67
  gettext (>= 3.0.2, < 3.3.0)
68
68
  locale
69
- google-apis-core (0.11.1)
69
+ google-apis-core (0.11.2)
70
70
  addressable (~> 2.5, >= 2.5.1)
71
71
  googleauth (>= 0.16.2, < 2.a)
72
72
  httpclient (>= 2.8.1, < 3.a)
@@ -77,29 +77,30 @@ GEM
77
77
  webrick
78
78
  google-apis-iamcredentials_v1 (0.17.0)
79
79
  google-apis-core (>= 0.11.0, < 2.a)
80
- google-apis-storage_v1 (0.19.0)
81
- google-apis-core (>= 0.9.0, < 2.a)
82
- google-cloud-core (1.6.0)
83
- google-cloud-env (~> 1.0)
80
+ google-apis-storage_v1 (0.31.0)
81
+ google-apis-core (>= 0.11.0, < 2.a)
82
+ google-cloud-core (1.6.1)
83
+ google-cloud-env (>= 1.0, < 3.a)
84
84
  google-cloud-errors (~> 1.0)
85
- google-cloud-env (1.6.0)
86
- faraday (>= 0.17.3, < 3.0)
85
+ google-cloud-env (2.1.0)
86
+ faraday (>= 1.0, < 3.a)
87
87
  google-cloud-errors (1.3.1)
88
- google-cloud-storage (1.44.0)
88
+ google-cloud-storage (1.47.0)
89
89
  addressable (~> 2.8)
90
90
  digest-crc (~> 0.4)
91
91
  google-apis-iamcredentials_v1 (~> 0.1)
92
- google-apis-storage_v1 (~> 0.19.0)
92
+ google-apis-storage_v1 (~> 0.31.0)
93
93
  google-cloud-core (~> 1.6)
94
94
  googleauth (>= 0.16.2, < 2.a)
95
95
  mini_mime (~> 1.0)
96
- googleauth (1.8.1)
97
- faraday (>= 0.17.3, < 3.a)
96
+ googleauth (1.9.1)
97
+ faraday (>= 1.0, < 3.a)
98
+ google-cloud-env (~> 2.1)
98
99
  jwt (>= 1.4, < 3.0)
99
100
  multi_json (~> 1.11)
100
101
  os (>= 0.9, < 2.0)
101
102
  signet (>= 0.16, < 2.a)
102
- hashdiff (1.0.1)
103
+ hashdiff (1.1.0)
103
104
  hiera (3.12.0)
104
105
  hiera-eyaml (3.4.0)
105
106
  highline
@@ -121,24 +122,24 @@ GEM
121
122
  mustache (1.1.1)
122
123
  optimist (3.1.0)
123
124
  os (1.1.4)
124
- parallel (1.23.0)
125
- parser (3.2.2.4)
125
+ parallel (1.24.0)
126
+ parser (3.3.0.4)
126
127
  ast (~> 2.4.1)
127
128
  racc
128
129
  pry (0.14.2)
129
130
  coderay (~> 1.1)
130
131
  method_source (~> 1.0)
131
- public_suffix (5.0.3)
132
+ public_suffix (5.0.4)
132
133
  puppet-resource_api (1.9.0)
133
134
  hocon (>= 1.0)
134
135
  puppetserver-ca (2.6.0)
135
136
  facter (>= 2.0.1, < 5)
136
137
  racc (1.5.2)
137
138
  rainbow (3.1.1)
138
- rake (13.0.6)
139
- rdiscount (2.2.7.1)
139
+ rake (13.1.0)
140
+ rdiscount (2.2.7.3)
140
141
  rdoc (6.3.3)
141
- regexp_parser (2.8.2)
142
+ regexp_parser (2.9.0)
142
143
  release-metrics (1.1.0)
143
144
  csv
144
145
  docopt
@@ -177,7 +178,7 @@ GEM
177
178
  rubocop-ast (>= 1.17.0, < 2.0)
178
179
  ruby-progressbar (~> 1.7)
179
180
  unicode-display_width (>= 1.4.0, < 3.0)
180
- rubocop-ast (1.29.0)
181
+ rubocop-ast (1.30.0)
181
182
  parser (>= 3.2.1.0)
182
183
  rubocop-i18n (3.0.0)
183
184
  rubocop (~> 1.0)
data/Rakefile CHANGED
@@ -58,33 +58,6 @@ task(:rubocop) do
58
58
  raise "RuboCop detected offenses" if exit_code != 0
59
59
  end
60
60
 
61
- desc "verify that commit messages match CONTRIBUTING.md requirements"
62
- task(:commits) do
63
- # This rake task looks at the summary from every commit from this branch not
64
- # in the branch targeted for a PR.
65
- commit_range = 'HEAD^..HEAD'
66
- puts "Checking commits #{commit_range}"
67
- %x{git log --no-merges --pretty=%s #{commit_range}}.each_line do |commit_summary|
68
- # This regex tests for the currently supported commit summary tokens: maint, doc, packaging, or pup-<number>.
69
- # The exception tries to explain it in more full.
70
- if /^\((maint|doc|docs|packaging|l10n|pup-\d+)\)|revert/i.match(commit_summary).nil?
71
- raise "\n\n\n\tThis commit summary didn't match CONTRIBUTING.md guidelines:\n" \
72
- "\n\t\t#{commit_summary}\n" \
73
- "\tThe commit summary (i.e. the first line of the commit message) should start with one of:\n" \
74
- "\t\t(PUP-<digits>) # this is most common and should be a ticket at tickets.puppet.com\n" \
75
- "\t\t(docs)\n" \
76
- "\t\t(docs)(DOCUMENT-<digits>)\n" \
77
- "\t\t(maint)\n" \
78
- "\t\t(packaging)\n" \
79
- "\t\t(L10n)\n" \
80
- "\n\tThis test for the commit summary is case-insensitive.\n\n\n"
81
- else
82
- puts "#{commit_summary}"
83
- end
84
- puts "...passed"
85
- end
86
- end
87
-
88
61
  desc "verify that changed files are clean of Ruby warnings"
89
62
  task(:warnings) do
90
63
  # This rake task looks at all files modified in this branch.
@@ -133,7 +133,7 @@ class ExternalNode
133
133
  patternlist = []
134
134
 
135
135
  begin
136
- open(filepath).each do |l|
136
+ File.open(filepath).each do |l|
137
137
  l.chomp!
138
138
 
139
139
  next if l =~ /^$/
@@ -194,7 +194,6 @@ class Puppet::Configurer
194
194
  path.push(key)
195
195
  parse_fact_name_and_value_limits(value, path)
196
196
  path.pop
197
- @number_of_facts += 1
198
197
  end
199
198
  when Array
200
199
  object.each_with_index do |e, idx|
@@ -205,6 +204,7 @@ class Puppet::Configurer
205
204
  else
206
205
  check_fact_name_length(path.join(), path.size)
207
206
  check_fact_values_length(object)
207
+ @number_of_facts += 1
208
208
  end
209
209
  end
210
210
 
@@ -150,7 +150,7 @@ class Puppet::FileSystem::FileImpl
150
150
  end
151
151
 
152
152
  def compare_stream(path, stream)
153
- open(path, 0, 'rb') { |this| FileUtils.compare_stream(this, stream) }
153
+ ::File.open(path, 0, 'rb') { |this| FileUtils.compare_stream(this, stream) }
154
154
  end
155
155
 
156
156
  def chmod(mode, path)
@@ -10,7 +10,7 @@ class Puppet::FileSystem::Posix < Puppet::FileSystem::FileImpl
10
10
  # issue this method reimplements the faster 2.0 version that will correctly
11
11
  # compare binary File and StringIO streams.
12
12
  def compare_stream(path, stream)
13
- open(path, 0, 'rb') do |this|
13
+ ::File.open(path, 'rb') do |this|
14
14
  bsize = stream_blksize(this, stream)
15
15
  sa = "".force_encoding('ASCII-8BIT')
16
16
  sb = "".force_encoding('ASCII-8BIT')
@@ -4,7 +4,7 @@ require_relative '../../puppet/util/package'
4
4
  #
5
5
  # Prototype:
6
6
  #
7
- # \$result = versioncmp(a, b)
7
+ # $result = versioncmp(a, b)
8
8
  #
9
9
  # Where a and b are arbitrary version strings.
10
10
  #
@@ -119,6 +119,10 @@ class Puppet::HTTP::Service::Compiler < Puppet::HTTP::Service
119
119
  params: { environment: environment },
120
120
  )
121
121
 
122
+ if (compiler = response['X-Puppet-Compiler-Name'])
123
+ Puppet.notice("Catalog compiled by #{compiler}")
124
+ end
125
+
122
126
  process_response(response)
123
127
 
124
128
  [response, deserialize(response, Puppet::Resource::Catalog)]
@@ -53,12 +53,20 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
53
53
  node.trusted_data = Puppet.lookup(:trusted_information) { Puppet::Context::TrustedInformation.local(node) }.to_h
54
54
 
55
55
  if node.environment
56
- # If the requested environment doesn't match the server specified environment,
57
- # as determined by the node terminus, and the request wants us to check for an
56
+ # If the requested environment name doesn't match the server specified environment
57
+ # name, as determined by the node terminus, and the request wants us to check for an
58
58
  # environment mismatch, then return an empty catalog with the server-specified
59
59
  # enviroment.
60
- if request.remote? && request.options[:check_environment] && node.environment != request.environment
61
- return Puppet::Resource::Catalog.new(node.name, node.environment)
60
+ if request.remote? && request.options[:check_environment]
61
+ # The "environment" may be same while environment objects differ. This
62
+ # is most likely because the environment cache was flushed between the request
63
+ # processing and node lookup. Environment overrides `==` but requires the
64
+ # name and modulepath to be the same. When using versioned environment dirs the
65
+ # same "environment" can have different modulepaths so simply compare names here.
66
+ if node.environment.name != request.environment.name
67
+ Puppet.warning _("Requested environment '%{request_env}' did not match server specified environment '%{server_env}'") % {request_env: request.environment.name, server_env: node.environment.name}
68
+ return Puppet::Resource::Catalog.new(node.name, node.environment)
69
+ end
62
70
  end
63
71
 
64
72
  node.environment.with_text_domain do
@@ -13,6 +13,14 @@ class Puppet::Resource::Catalog::Rest < Puppet::Indirector::REST
13
13
 
14
14
  session = Puppet.lookup(:http_session)
15
15
  api = session.route_to(:puppet)
16
+
17
+ ip_address = begin
18
+ " (#{Resolv.getaddress(api.url.host)})"
19
+ rescue Resolv::ResolvError
20
+ nil
21
+ end
22
+ Puppet.notice("Requesting catalog from #{api.url.host}:#{api.url.port}#{ip_address}")
23
+
16
24
  _, catalog = api.post_catalog(
17
25
  request.key,
18
26
  facts: request.options[:facts_for_catalog],
@@ -264,12 +264,14 @@ def #{@name}(#{decl.join(", ")})
264
264
  end
265
265
  WRAPPER
266
266
 
267
+ # It should be possible to rewrite this code to use `define_method`
268
+ # instead of `class/instance_eval` since Ruby 1.8 is long dead.
267
269
  if @face.is_a?(Class)
268
- @face.class_eval do eval wrapper, nil, file, line end
270
+ @face.class_eval do eval wrapper, nil, file, line end # rubocop:disable Security/Eval
269
271
  @face.send(:define_method, internal_name, &block)
270
272
  @when_invoked = @face.instance_method(name)
271
273
  else
272
- @face.instance_eval do eval wrapper, nil, file, line end
274
+ @face.instance_eval do eval wrapper, nil, file, line end # rubocop:disable Security/Eval
273
275
  @face.meta_def(internal_name, &block)
274
276
  @when_invoked = @face.method(name).unbind
275
277
  end
@@ -4,6 +4,8 @@
4
4
  # within the context of a new instance of this class.
5
5
  # @api public
6
6
  class Puppet::Interface::ActionBuilder
7
+ extend Forwardable
8
+
7
9
  # The action under construction
8
10
  # @return [Puppet::Interface::Action]
9
11
  # @api private
@@ -141,15 +143,8 @@ class Puppet::Interface::ActionBuilder
141
143
  property = setter.to_s.chomp('=')
142
144
 
143
145
  unless method_defined? property
144
- # Using eval because the argument handling semantics are less awful than
145
- # when we use the define_method/block version. The later warns on older
146
- # Ruby versions if you pass the wrong number of arguments, but carries
147
- # on, which is totally not what we want. --daniel 2011-04-18
148
- eval <<-METHOD
149
- def #{property}(value)
150
- @action.#{property} = value
151
- end
152
- METHOD
146
+ # ActionBuilder#<property> delegates to Action#<setter>
147
+ def_delegator :@action, setter, property
153
148
  end
154
149
  end
155
150
 
@@ -19,7 +19,7 @@ class Puppet::Pops::Loader::RubyDataTypeInstantiator
19
19
  # make the private loader available in a binding to allow it to be passed on
20
20
  loader_for_type = loader.private_loader
21
21
  here = get_binding(loader_for_type)
22
- created = eval(ruby_code_string, here, source_ref, 1)
22
+ created = eval(ruby_code_string, here, source_ref, 1) # rubocop:disable Security/Eval
23
23
  unless created.is_a?(Puppet::Pops::Types::PAnyType)
24
24
  raise ArgumentError, _("The code loaded from %{source_ref} did not produce a data type when evaluated. Got '%{klass}'") % { source_ref: source_ref, klass: created.class }
25
25
  end
@@ -19,7 +19,7 @@ class Puppet::Pops::Loader::RubyFunctionInstantiator
19
19
  # make the private loader available in a binding to allow it to be passed on
20
20
  loader_for_function = loader.private_loader
21
21
  here = get_binding(loader_for_function)
22
- created = eval(ruby_code_string, here, source_ref, 1)
22
+ created = eval(ruby_code_string, here, source_ref, 1) # rubocop:disable Security/Eval
23
23
  unless created.is_a?(Class)
24
24
  raise ArgumentError, _("The code loaded from %{source_ref} did not produce a Function class when evaluated. Got '%{klass}'") % { source_ref: source_ref, klass: created.class }
25
25
  end
@@ -37,7 +37,7 @@ class Puppet::Pops::Loader::RubyLegacyFunctionInstantiator
37
37
  # This will do the 3x loading and define the "function_<name>" and "real_function_<name>" methods
38
38
  # in the anonymous module used to hold function definitions.
39
39
  #
40
- func_info = eval(ruby_code_string, here, source_ref, 1)
40
+ func_info = eval(ruby_code_string, here, source_ref, 1) # rubocop:disable Security/Eval
41
41
 
42
42
  # Validate what was loaded
43
43
  unless func_info.is_a?(Hash)
@@ -66,7 +66,7 @@ Puppet::Type.type(:package).provide(:appdmg, :parent => Puppet::Provider::Packag
66
66
  end
67
67
  end
68
68
 
69
- open(cached_source) do |dmg|
69
+ File.open(cached_source) do |dmg|
70
70
  xml_str = hdiutil "mount", "-plist", "-nobrowse", "-readonly", "-mountrandom", "/tmp", dmg.path
71
71
  ptable = Puppet::Util::Plist::parse_plist(xml_str)
72
72
  # JJM Filter out all mount-paths into a single array, discard the rest.
@@ -32,6 +32,7 @@ Puppet::Type.type(:package).provide :dnf, :parent => :yum do
32
32
  notdefaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => (19..21).to_a
33
33
  defaultfor :osfamily => :redhat
34
34
  notdefaultfor :osfamily => :redhat, :operatingsystemmajrelease => (4..7).to_a
35
+ defaultfor :operatingsystem => :amazon, :operatingsystemmajrelease => ["2023"]
35
36
 
36
37
  def self.update_command
37
38
  # In DNF, update is deprecated for upgrade
@@ -93,7 +93,7 @@ Puppet::Type.type(:package).provide :dnfmodule, :parent => :dnf do
93
93
  # module has no default profile and no profile was requested, so just enable the stream
94
94
  # DNF versions prior to 4.2.8 do not need this workaround
95
95
  # see https://bugzilla.redhat.com/show_bug.cgi?id=1669527
96
- if @resource[:flavor] == nil && e.message =~ /^(?:missing|broken) groups or modules: #{Regexp.quote(@resource[:name])}$/
96
+ if @resource[:flavor] == nil && e.message =~ /^(?:missing|broken) groups or modules: #{Regexp.quote(args)}$/
97
97
  enable(args)
98
98
  else
99
99
  raise
@@ -43,9 +43,9 @@ class Puppet::Provider::Package::Windows
43
43
  [KEY64, KEY32].each do |mode|
44
44
  mode |= KEY_READ
45
45
  begin
46
- open(hive, 'Software\Microsoft\Windows\CurrentVersion\Uninstall', mode) do |uninstall|
46
+ self.open(hive, 'Software\Microsoft\Windows\CurrentVersion\Uninstall', mode) do |uninstall|
47
47
  each_key(uninstall) do |name, wtime|
48
- open(hive, "#{uninstall.keyname}\\#{name}", mode) do |key|
48
+ self.open(hive, "#{uninstall.keyname}\\#{name}", mode) do |key|
49
49
  yield key, values_by_name(key, reg_value_names_to_load)
50
50
  end
51
51
  end
@@ -255,7 +255,7 @@ defaultfor :osfamily => :redhat, :operatingsystemmajrelease => (4..7).to_a
255
255
  operation = update_command
256
256
  self.debug "Ensuring latest, so using #{operation}"
257
257
  else
258
- self.debug "Ensuring latest, but package is absent, so using #{:install}"
258
+ self.debug "Ensuring latest, but package is absent, so using install"
259
259
  operation = :install
260
260
  end
261
261
  should = nil
@@ -19,12 +19,9 @@ Puppet::Type.type(:service).provide :init, :parent => :base do
19
19
  end
20
20
 
21
21
  # Debian and Ubuntu should use the Debian provider.
22
+ confine :false => ['Debian', 'Ubuntu'].include?(Puppet.runtime[:facter].value('operatingsystem'))
22
23
  # RedHat systems should use the RedHat provider.
23
- confine :true => begin
24
- os = Puppet.runtime[:facter].value(:operatingsystem).downcase
25
- family = Puppet.runtime[:facter].value(:osfamily).downcase
26
- !(os == 'debian' || os == 'ubuntu' || family == 'redhat')
27
- end
24
+ confine :false => Puppet.runtime[:facter].value('osfamily') == 'RedHat'
28
25
 
29
26
  # We can't confine this here, because the init path can be overridden.
30
27
  #confine :exists => defpath
@@ -18,7 +18,8 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
18
18
  defaultfor :osfamily => :redhat, :operatingsystem => :fedora
19
19
  defaultfor :osfamily => :suse
20
20
  defaultfor :osfamily => :coreos
21
- defaultfor :operatingsystem => :amazon, :operatingsystemmajrelease => ["2"]
21
+ defaultfor :osfamily => :gentoo
22
+ defaultfor :operatingsystem => :amazon, :operatingsystemmajrelease => ["2", "2023"]
22
23
  defaultfor :operatingsystem => :debian
23
24
  notdefaultfor :operatingsystem => :debian, :operatingsystemmajrelease => ["5", "6", "7"] # These are using the "debian" method
24
25
  defaultfor :operatingsystem => :LinuxMint
@@ -39,8 +40,8 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
39
40
  return []
40
41
  end
41
42
 
42
- # Static services cannot be enabled or disabled manually. Indirect services
43
- # should not be enabled or disabled due to limitations in systemd (see
43
+ # Static services cannot be enabled or disabled manually. Indirect services
44
+ # should not be enabled or disabled due to limitations in systemd (see
44
45
  # https://github.com/systemd/systemd/issues/6681).
45
46
  def enabled_insync?(current)
46
47
  case cached_enabled?[:output]
@@ -5,6 +5,7 @@ require_relative '../puppet/util/command_line/puppet_option_parser'
5
5
  require 'forwardable'
6
6
  require 'fileutils'
7
7
  require 'concurrent'
8
+ require_relative 'concurrent/lock'
8
9
 
9
10
  # The class for handling configuration files.
10
11
  class Puppet::Settings
@@ -146,8 +147,21 @@ class Puppet::Settings
146
147
  @configuration_file = nil
147
148
 
148
149
  # And keep a per-environment cache
149
- @cache = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new }
150
- @values = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new }
150
+ # We can't use Concurrent::Map because we want to preserve insertion order
151
+ @cache_lock = Puppet::Concurrent::Lock.new
152
+ @cache = Concurrent::Hash.new do |hash, key|
153
+ @cache_lock.synchronize do
154
+ break hash[key] if hash.key?(key)
155
+ hash[key] = Concurrent::Hash.new
156
+ end
157
+ end
158
+ @values_lock = Puppet::Concurrent::Lock.new
159
+ @values = Concurrent::Hash.new do |hash, key|
160
+ @values_lock.synchronize do
161
+ break hash[key] if hash.key?(key)
162
+ hash[key] = Concurrent::Hash.new
163
+ end
164
+ end
151
165
 
152
166
  # The list of sections we've used.
153
167
  @used = []
@@ -1,6 +1,7 @@
1
1
  require_relative '../../puppet/ssl'
2
2
 
3
3
  module Puppet::SSL
4
+ # The `keyword_init: true` option is no longer needed in Ruby >= 3.2
4
5
  SSLContext = Struct.new(
5
6
  :store,
6
7
  :cacerts,
@@ -9,22 +10,16 @@ module Puppet::SSL
9
10
  :client_cert,
10
11
  :client_chain,
11
12
  :revocation,
12
- :verify_peer
13
+ :verify_peer,
14
+ keyword_init: true
13
15
  ) do
14
- DEFAULTS = {
15
- cacerts: [],
16
- crls: [],
17
- client_chain: [],
18
- revocation: true,
19
- verify_peer: true
20
- }.freeze
21
-
22
- # This is an idiom to initialize a Struct from keyword
23
- # arguments. Ruby 2.5 introduced `keyword_init: true` for
24
- # that purpose, but we need to support older versions.
25
- def initialize(kwargs = {})
26
- super({})
27
- DEFAULTS.merge(**kwargs).each { |k,v| self[k] = v }
16
+ def initialize(*)
17
+ super
18
+ self[:cacerts] ||= []
19
+ self[:crls] ||= []
20
+ self[:client_chain] ||= []
21
+ self[:revocation] = true if self[:revocation].nil?
22
+ self[:verify_peer] = true if self[:verify_peer].nil?
28
23
  end
29
24
  end
30
25
  end
@@ -63,7 +63,7 @@ Puppet::Type.newtype(:component) do
63
63
  catalog.adjacent(self).each do |child|
64
64
  if child.respond_to?(:refresh)
65
65
  child.refresh
66
- child.log "triggering #{:refresh}"
66
+ child.log "triggering refresh"
67
67
  end
68
68
  end
69
69
  end
@@ -592,13 +592,17 @@ module Puppet
592
592
  cmd = self[:command]
593
593
  cmd = cmd[0] if cmd.is_a? Array
594
594
 
595
- cmd.scan(file_regex) { |str|
596
- reqs << str
597
- }
595
+ if cmd.is_a?(Puppet::Pops::Evaluator::DeferredValue)
596
+ self.debug("The 'command' parameter is deferred and cannot be autorequired")
597
+ else
598
+ cmd.scan(file_regex) { |str|
599
+ reqs << str
600
+ }
598
601
 
599
- cmd.scan(/^"([^"]+)"/) { |str|
600
- reqs << str
601
- }
602
+ cmd.scan(/^"([^"]+)"/) { |str|
603
+ reqs << str
604
+ }
605
+ end
602
606
 
603
607
  [:onlyif, :unless].each { |param|
604
608
  tmp = self[param]
@@ -613,7 +617,11 @@ module Puppet
613
617
  # unqualified files, but, well, that's a bit more annoying
614
618
  # to do.
615
619
  line = line[0] if line.is_a? Array
616
- reqs += line.scan(file_regex)
620
+ if line.is_a?(Puppet::Pops::Evaluator::DeferredValue)
621
+ self.debug("The '#{param}' parameter is deferred and cannot be autorequired")
622
+ else
623
+ reqs += line.scan(file_regex)
624
+ end
617
625
  end
618
626
  }
619
627
 
@@ -7,6 +7,7 @@ Puppet::Type.newtype(:resources) do
7
7
  so you can purge unmanaged resources but set `noop` to true so the
8
8
  purging is only logged and does not actually happen."
9
9
 
10
+ apply_to_all
10
11
 
11
12
  newparam(:name) do
12
13
  desc "The name of the type to be managed."
@@ -649,7 +649,7 @@ private
649
649
  else
650
650
  require 'open-uri'
651
651
  begin
652
- open param
652
+ URI.parse(param).open
653
653
  rescue SystemCallError => e
654
654
  raise CommandlineError, _("file or url for option '%{arg}' cannot be opened: %{value0}") % { arg: arg, value0: e.message }, e.backtrace
655
655
  end
@@ -77,7 +77,8 @@ module Puppet::Util::Execution
77
77
  # a predictable output
78
78
  english_env = ENV.to_hash.merge( {'LANG' => 'C', 'LC_ALL' => 'C'} )
79
79
  output = Puppet::Util.withenv(english_env) do
80
- open("| #{command_str} 2>&1") do |pipe|
80
+ # We are intentionally using 'pipe' with open to launch a process
81
+ open("| #{command_str} 2>&1") do |pipe| # rubocop:disable Security/Open
81
82
  yield pipe
82
83
  end
83
84
  end
@@ -149,10 +149,10 @@ module Puppet::Util::Package::Version
149
149
  return compare(element, other.at(index)) if element != other.at(index)
150
150
  end
151
151
  elsif (this.is_a? Array) && !(other.is_a? Array)
152
- raise Puppet::Error, 'Cannot compare #{this} (Array) with #{other} (#{other.class}). Only ±Float::INFINITY accepted.' unless other.abs == Float::INFINITY
152
+ raise Puppet::Error, "Cannot compare #{this} (Array) with #{other} (#{other.class}). Only ±Float::INFINITY accepted." unless other.abs == Float::INFINITY
153
153
  return other == -Float::INFINITY ? 1 : -1
154
154
  elsif !(this.is_a? Array) && (other.is_a? Array)
155
- raise Puppet::Error, 'Cannot compare #{this} (#{this.class}) with #{other} (Array). Only ±Float::INFINITY accepted.' unless this.abs == Float::INFINITY
155
+ raise Puppet::Error, "Cannot compare #{this} (#{this.class}) with #{other} (Array). Only ±Float::INFINITY accepted." unless this.abs == Float::INFINITY
156
156
  return this == -Float::INFINITY ? -1 : 1
157
157
  end
158
158
  this <=> other
@@ -6,7 +6,7 @@
6
6
  # Raketasks and such to set the version based on the output of `git describe`
7
7
 
8
8
  module Puppet
9
- PUPPETVERSION = '7.27.0'
9
+ PUPPETVERSION = '7.28.0'
10
10
 
11
11
  ##
12
12
  # version is a public API method intended to always provide a fast and
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPETCONF" "5" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPETCONF" "5" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  \fBThis page is autogenerated; any changes will get overwritten\fR
6
6
  .
7
7
  .SH "Configuration settings"
@@ -945,7 +945,7 @@ The time to wait for data to be read from an HTTP connection\. If nothing is rea
945
945
  The HTTP User\-Agent string to send when making network requests\.
946
946
  .
947
947
  .IP "\(bu" 4
948
- \fIDefault\fR: \fBPuppet/7\.27\.0 Ruby/2\.7\.5\-p203 (x86_64\-linux)\fR
948
+ \fIDefault\fR: \fBPuppet/7\.28\.0 Ruby/2\.7\.5\-p203 (x86_64\-linux)\fR
949
949
  .
950
950
  .IP "" 0
951
951
  .
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-AGENT" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-AGENT" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-agent\fR \- The puppet agent daemon
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-APPLY" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-APPLY" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-apply\fR \- Apply Puppet manifests locally
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-CATALOG" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CATALOG" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-catalog\fR \- Compile, save, view, and convert catalogs\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-CONFIG" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CONFIG" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-config\fR \- Interact with Puppet\'s settings\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-DESCRIBE" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DESCRIBE" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-describe\fR \- Display help about resource types
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-DEVICE" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DEVICE" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-device\fR \- Manage remote network devices
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-DOC" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DOC" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-doc\fR \- Generate Puppet references
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-EPP" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-EPP" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-epp\fR \- Interact directly with the EPP template parser/renderer\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-FACTS" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FACTS" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-facts\fR \- Retrieve and store facts\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-FILEBUCKET" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FILEBUCKET" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-filebucket\fR \- Store and retrieve files in a filebucket
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-GENERATE" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-GENERATE" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-generate\fR \- Generates Puppet code from Ruby definitions\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-HELP" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-HELP" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-help\fR \- Display Puppet help\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-LOOKUP" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-LOOKUP" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-lookup\fR \- Interactive Hiera lookup
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-MODULE" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-MODULE" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-module\fR \- Creates, installs and searches for modules on the Puppet Forge\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-NODE" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-NODE" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-node\fR \- View and manage node definitions\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-PARSER" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-PARSER" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-parser\fR \- Interact directly with the parser\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-PLUGIN" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-PLUGIN" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-plugin\fR \- Interact with the Puppet plugin system\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-REPORT" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-REPORT" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-report\fR \- Create, display, and submit reports\.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-RESOURCE" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-RESOURCE" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-resource\fR \- The resource abstraction layer shell
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-SCRIPT" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-SCRIPT" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-script\fR \- Run a puppet manifests as a script without compiling a catalog
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET\-SSL" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-SSL" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-ssl\fR \- Manage SSL keys and certificates for puppet SSL clients
data/man/man8/puppet.8 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "PUPPET" "8" "October 2023" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET" "8" "December 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\fR
@@ -25,4 +25,4 @@ Specialized:
25
25
  catalog Compile, save, view, and convert catalogs\. describe Display help about resource types device Manage remote network devices doc Generate Puppet references epp Interact directly with the EPP template parser/renderer\. facts Retrieve and store facts\. filebucket Store and retrieve files in a filebucket generate Generates Puppet code from Ruby definitions\. node View and manage node definitions\. parser Interact directly with the parser\. plugin Interact with the Puppet plugin system\. script Run a puppet manifests as a script without compiling a catalog ssl Manage SSL keys and certificates for puppet SSL clients
26
26
  .
27
27
  .P
28
- See \'puppet help \fIsubcommand\fR \fIaction\fR\' for help on a specific subcommand action\. See \'puppet help \fIsubcommand\fR\' for help on a specific subcommand\. Puppet v7\.27\.0
28
+ See \'puppet help \fIsubcommand\fR \fIaction\fR\' for help on a specific subcommand action\. See \'puppet help \fIsubcommand\fR\' for help on a specific subcommand\. Puppet v7\.28\.0
@@ -15,6 +15,19 @@ describe "puppet agent", unless: Puppet::Util::Platform.jruby? do
15
15
  let(:node) { Puppet::Node.new(Puppet[:certname], environment: 'production')}
16
16
  let(:formatter) { Puppet::Network::FormatHandler.format(:rich_data_json) }
17
17
 
18
+ context 'server identification' do
19
+ it 'emits a notice if the server sends the X-Puppet-Compiler-Name header' do
20
+ server.start_server do |port|
21
+ Puppet[:serverport] = port
22
+ expect {
23
+ agent.command_line.args << '--test'
24
+ agent.run
25
+ }.to exit_with(0)
26
+ .and output(%r{Notice: Catalog compiled by test-compiler-hostname}).to_stdout
27
+ end
28
+ end
29
+ end
30
+
18
31
  context 'server_list' do
19
32
  it "uses the first server in the list" do
20
33
  Puppet[:server_list] = '127.0.0.1'
@@ -19,6 +19,7 @@ class PuppetSpec::Puppetserver
19
19
  class CatalogServlet < WEBrick::HTTPServlet::AbstractServlet
20
20
  def do_POST request, response
21
21
  response['Content-Type'] = 'application/json'
22
+ response['X-Puppet-Compiler-Name'] = 'test-compiler-hostname'
22
23
  catalog = Puppet::Resource::Catalog.new(Puppet[:certname], 'production')
23
24
  response.body = catalog.render(:json)
24
25
  end
@@ -271,6 +271,23 @@ describe Puppet::Resource::Catalog::Compiler do
271
271
  expect(catalog).to have_resource('Stage[main]')
272
272
  end
273
273
 
274
+ # versioned environment directories can cause this
275
+ it 'allows environments with the same name but mismatched modulepaths' do
276
+ envs = Puppet.lookup(:environments)
277
+ env_server = envs.get!(:env_server)
278
+ v1_env = env_server.override_with({ modulepath: ['/code-v1/env-v1/'] })
279
+ v2_env = env_server.override_with({ modulepath: ['/code-v2/env-v2/'] })
280
+
281
+ @request.options[:check_environment] = "true"
282
+ @request.environment = v1_env
283
+ node.environment = v2_env
284
+
285
+ catalog = compiler.find(@request)
286
+
287
+ expect(catalog.environment).to eq('env_server')
288
+ expect(catalog).to have_resource('Stage[main]')
289
+ end
290
+
274
291
  it 'returns an empty catalog if asked to check the environment and they are mismatched' do
275
292
  @request.options[:check_environment] = "true"
276
293
  catalog = compiler.find(@request)
@@ -25,6 +25,23 @@ describe Puppet::Resource::Catalog::Rest do
25
25
  expect(described_class.indirection.find(certname)).to be_a(Puppet::Resource::Catalog)
26
26
  end
27
27
 
28
+ it 'logs a notice when requesting a catalog' do
29
+ expect(Puppet).to receive(:notice).with("Requesting catalog from compiler.example.com:8140")
30
+
31
+ stub_request(:post, uri).to_return(**catalog_response(catalog))
32
+
33
+ described_class.indirection.find(certname)
34
+ end
35
+
36
+ it 'logs a notice when the IP address is resolvable when requesting a catalog' do
37
+ allow(Resolv).to receive_message_chain(:getaddress).and_return('192.0.2.0')
38
+ expect(Puppet).to receive(:notice).with("Requesting catalog from compiler.example.com:8140 (192.0.2.0)")
39
+
40
+ stub_request(:post, uri).to_return(**catalog_response(catalog))
41
+
42
+ described_class.indirection.find(certname)
43
+ end
44
+
28
45
  it "serializes the environment" do
29
46
  stub_request(:post, uri)
30
47
  .with(query: hash_including('environment' => 'outerspace'))
@@ -11,7 +11,7 @@ describe Puppet::Type.type(:package).provider(:appdmg) do
11
11
  before do
12
12
  fh = double('filehandle', path: '/tmp/foo')
13
13
  resource[:source] = "foo.dmg"
14
- allow(described_class).to receive(:open).and_yield(fh)
14
+ allow(File).to receive(:open).and_yield(fh)
15
15
  allow(Dir).to receive(:mktmpdir).and_return("/tmp/testtmp123")
16
16
  allow(FileUtils).to receive(:remove_entry_secure)
17
17
  end
@@ -42,6 +42,13 @@ describe Puppet::Type.type(:package).provider(:dnf) do
42
42
  allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("8")
43
43
  expect(described_class).to be_default
44
44
  end
45
+
46
+ it "should be the default provider on Amazon Linux 2023" do
47
+ allow(Facter).to receive(:value).with(:osfamily).and_return(:redhat)
48
+ allow(Facter).to receive(:value).with(:operatingsystem).and_return(:amazon)
49
+ allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("2023")
50
+ expect(described_class).to be_default
51
+ end
45
52
  end
46
53
 
47
54
  describe 'provider features' do
@@ -123,7 +123,7 @@ describe Puppet::Type.type(:package).provider(:dnfmodule) do
123
123
  provider.install
124
124
  end
125
125
 
126
- it "should just enable the module if it has no default profile(missing groups or modules)" do
126
+ it "should just enable the module if it has no default profile (missing groups or modules)" do
127
127
  dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nmissing groups or modules: #{resource[:name]}")
128
128
  allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
129
129
  resource[:ensure] = :present
@@ -132,7 +132,17 @@ describe Puppet::Type.type(:package).provider(:dnfmodule) do
132
132
  provider.install
133
133
  end
134
134
 
135
- it "should just enable the module if it has no default profile(broken groups or modules)" do
135
+ it "should just enable the module with the right stream if it has no default profile (missing groups or modules)" do
136
+ stream = '12.3'
137
+ dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nmissing groups or modules: #{resource[:name]}:#{stream}")
138
+ allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
139
+ resource[:ensure] = stream
140
+ expect(provider).to receive(:execute).with(array_including('install')).ordered
141
+ expect(provider).to receive(:execute).with(array_including('enable')).ordered
142
+ provider.install
143
+ end
144
+
145
+ it "should just enable the module if it has no default profile (broken groups or modules)" do
136
146
  dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nbroken groups or modules: #{resource[:name]}")
137
147
  allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
138
148
  resource[:ensure] = :present
@@ -141,6 +151,16 @@ describe Puppet::Type.type(:package).provider(:dnfmodule) do
141
151
  provider.install
142
152
  end
143
153
 
154
+ it "should just enable the module with the right stream if it has no default profile (broken groups or modules)" do
155
+ stream = '12.3'
156
+ dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nbroken groups or modules: #{resource[:name]}:#{stream}")
157
+ allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
158
+ resource[:ensure] = stream
159
+ expect(provider).to receive(:execute).with(array_including('install')).ordered
160
+ expect(provider).to receive(:execute).with(array_including('enable')).ordered
161
+ provider.install
162
+ end
163
+
144
164
  it "should just enable the module if enable_only = true" do
145
165
  resource[:ensure] = :present
146
166
  resource[:enable_only] = true
@@ -18,7 +18,7 @@ describe 'Puppet::Type::Service::Provider::Systemd',
18
18
  Puppet::Util::Execution::ProcessOutput.new('', 0)
19
19
  end
20
20
 
21
- osfamilies = [ 'archlinux', 'coreos' ]
21
+ osfamilies = [ 'archlinux', 'coreos', 'gentoo' ]
22
22
 
23
23
  osfamilies.each do |osfamily|
24
24
  it "should be the default provider on #{osfamily}" do
@@ -56,11 +56,13 @@ describe 'Puppet::Type::Service::Provider::Systemd',
56
56
  end
57
57
  end
58
58
 
59
- it "should be the default provider on Amazon Linux 2.0" do
60
- allow(Facter).to receive(:value).with(:osfamily).and_return(:redhat)
61
- allow(Facter).to receive(:value).with(:operatingsystem).and_return(:amazon)
62
- allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("2")
63
- expect(provider_class).to be_default
59
+ [ 2, 2023 ].each do |ver|
60
+ it "should be the default provider on Amazon Linux #{ver}" do
61
+ allow(Facter).to receive(:value).with(:osfamily).and_return(:redhat)
62
+ allow(Facter).to receive(:value).with(:operatingsystem).and_return(:amazon)
63
+ allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("#{ver}")
64
+ expect(provider_class).to be_default
65
+ end
64
66
  end
65
67
 
66
68
  it "should not be the default provider on Amazon Linux 2017.09" do
@@ -252,6 +252,19 @@ RSpec.describe Puppet::Type.type(:exec) do
252
252
  expect(dependencies.collect(&:to_s)).to eq([Puppet::Relationship.new(tmp, execer).to_s])
253
253
  end
254
254
 
255
+ it "skips autorequire for deferred commands" do
256
+ foo = make_absolute('/bin/foo')
257
+ catalog = Puppet::Resource::Catalog.new
258
+ tmp = Puppet::Type.type(:file).new(:name => foo)
259
+ execer = Puppet::Type.type(:exec).new(:name => 'test array', :command => Puppet::Pops::Evaluator::DeferredValue.new(nil))
260
+
261
+ catalog.add_resource tmp
262
+ catalog.add_resource execer
263
+ dependencies = execer.autorequire(catalog)
264
+
265
+ expect(dependencies.collect(&:to_s)).to eq([])
266
+ end
267
+
255
268
  describe "when handling the path parameter" do
256
269
  expect = %w{one two three four}
257
270
  { "an array" => expect,
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.27.0
4
+ version: 7.28.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: 2023-10-23 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter