puppet 7.20.0-universal-darwin → 7.22.0-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +62 -48
  3. data/Guardfile.example +1 -1
  4. data/ext/project_data.yaml +1 -1
  5. data/ext/windows/service/daemon.rb +1 -1
  6. data/lib/puppet/application/lookup.rb +5 -5
  7. data/lib/puppet/defaults.rb +14 -0
  8. data/lib/puppet/indirector/facts/facter.rb +8 -1
  9. data/lib/puppet/info_service/task_information_service.rb +10 -2
  10. data/lib/puppet/transaction/report.rb +18 -1
  11. data/lib/puppet/type/resources.rb +1 -6
  12. data/lib/puppet/type/tidy.rb +3 -2
  13. data/lib/puppet/type/user.rb +1 -3
  14. data/lib/puppet/type.rb +10 -0
  15. data/lib/puppet/version.rb +1 -1
  16. data/man/man5/puppet.conf.5 +18 -2
  17. data/man/man8/puppet-agent.8 +1 -1
  18. data/man/man8/puppet-apply.8 +1 -1
  19. data/man/man8/puppet-catalog.8 +1 -1
  20. data/man/man8/puppet-config.8 +1 -1
  21. data/man/man8/puppet-describe.8 +1 -1
  22. data/man/man8/puppet-device.8 +1 -1
  23. data/man/man8/puppet-doc.8 +1 -1
  24. data/man/man8/puppet-epp.8 +1 -1
  25. data/man/man8/puppet-facts.8 +1 -1
  26. data/man/man8/puppet-filebucket.8 +1 -1
  27. data/man/man8/puppet-generate.8 +1 -1
  28. data/man/man8/puppet-help.8 +1 -1
  29. data/man/man8/puppet-lookup.8 +1 -1
  30. data/man/man8/puppet-module.8 +1 -1
  31. data/man/man8/puppet-node.8 +1 -1
  32. data/man/man8/puppet-parser.8 +1 -1
  33. data/man/man8/puppet-plugin.8 +1 -1
  34. data/man/man8/puppet-report.8 +1 -1
  35. data/man/man8/puppet-resource.8 +1 -1
  36. data/man/man8/puppet-script.8 +1 -1
  37. data/man/man8/puppet-ssl.8 +1 -1
  38. data/man/man8/puppet.8 +2 -2
  39. data/spec/integration/application/agent_spec.rb +100 -1
  40. data/spec/integration/application/lookup_spec.rb +55 -0
  41. data/spec/unit/agent_spec.rb +1 -1
  42. data/spec/unit/application/agent_spec.rb +1 -1
  43. data/spec/unit/application/device_spec.rb +1 -1
  44. data/spec/unit/application/resource_spec.rb +1 -1
  45. data/spec/unit/confiner_spec.rb +1 -1
  46. data/spec/unit/daemon_spec.rb +1 -1
  47. data/spec/unit/file_bucket/dipper_spec.rb +1 -1
  48. data/spec/unit/file_serving/fileset_spec.rb +14 -14
  49. data/spec/unit/file_system_spec.rb +3 -1
  50. data/spec/unit/graph/simple_graph_spec.rb +1 -1
  51. data/spec/unit/http/service/compiler_spec.rb +1 -1
  52. data/spec/unit/indirector/facts/facter_spec.rb +25 -0
  53. data/spec/unit/indirector/file_server_spec.rb +5 -5
  54. data/spec/unit/indirector/indirection_spec.rb +1 -1
  55. data/spec/unit/indirector/node/plain_spec.rb +1 -1
  56. data/spec/unit/info_service_spec.rb +21 -0
  57. data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
  58. data/spec/unit/network/formats_spec.rb +1 -1
  59. data/spec/unit/provider/file/posix_spec.rb +4 -4
  60. data/spec/unit/provider/ldap_spec.rb +3 -3
  61. data/spec/unit/provider/nameservice_spec.rb +15 -15
  62. data/spec/unit/provider/package/aix_spec.rb +1 -1
  63. data/spec/unit/provider/package/dpkg_spec.rb +3 -3
  64. data/spec/unit/provider/package/nim_spec.rb +2 -2
  65. data/spec/unit/provider/package/pkgutil_spec.rb +4 -4
  66. data/spec/unit/provider/parsedfile_spec.rb +4 -4
  67. data/spec/unit/provider/service/bsd_spec.rb +4 -4
  68. data/spec/unit/provider/service/debian_spec.rb +2 -2
  69. data/spec/unit/provider/service/gentoo_spec.rb +20 -20
  70. data/spec/unit/provider/service/openbsd_spec.rb +18 -18
  71. data/spec/unit/provider/service/openrc_spec.rb +19 -19
  72. data/spec/unit/provider/service/systemd_spec.rb +22 -22
  73. data/spec/unit/provider/service/upstart_spec.rb +6 -6
  74. data/spec/unit/provider/user/aix_spec.rb +1 -1
  75. data/spec/unit/provider/user/hpux_spec.rb +1 -1
  76. data/spec/unit/provider/user/openbsd_spec.rb +1 -1
  77. data/spec/unit/provider/user/useradd_spec.rb +1 -1
  78. data/spec/unit/reports/store_spec.rb +5 -1
  79. data/spec/unit/resource/type_spec.rb +2 -2
  80. data/spec/unit/ssl/base_spec.rb +1 -1
  81. data/spec/unit/ssl/certificate_request_spec.rb +1 -1
  82. data/spec/unit/ssl/certificate_spec.rb +1 -1
  83. data/spec/unit/transaction/event_manager_spec.rb +4 -4
  84. data/spec/unit/transaction/report_spec.rb +38 -1
  85. data/spec/unit/transaction_spec.rb +2 -2
  86. data/spec/unit/type/exec_spec.rb +1 -1
  87. data/spec/unit/type/file_spec.rb +4 -4
  88. data/spec/unit/type/filebucket_spec.rb +3 -3
  89. data/spec/unit/type/resources_spec.rb +14 -0
  90. data/spec/unit/type/tidy_spec.rb +27 -17
  91. data/spec/unit/util/backups_spec.rb +1 -1
  92. data/spec/unit/util/execution_spec.rb +6 -6
  93. data/spec/unit/util/filetype_spec.rb +3 -3
  94. data/spec/unit/util/network_device_spec.rb +1 -6
  95. data/spec/unit/util/resource_template_spec.rb +1 -1
  96. data/spec/unit/util/storage_spec.rb +1 -1
  97. data/spec/unit/x509/cert_provider_spec.rb +1 -1
  98. metadata +9 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbf13c9ad3cd1e67bca2ac2b0668e1937f16d57dcad406d9cdc108b3b6303dd5
4
- data.tar.gz: f5ef5169468e86e6f9b2b5742027756349b9cb75dfe221f06ea4c1a8a7b9c588
3
+ metadata.gz: e2cd7e029ce27e48180ecc3432b651ff6a2933c99166f31fd82b498fbadd9dc5
4
+ data.tar.gz: a98915aa4db761d30cc7b652179f998cb549382e01caf4cbcc2a0e82c1bd32e5
5
5
  SHA512:
6
- metadata.gz: 505af39a6f46979710e1510f0aa9454b9d98dfe13abf0fd3baa25da3f4cd80c1da4ad8f450488490d20f8159ec49f49b00a6ea5776e2b22bfdd869ff8d3edc77
7
- data.tar.gz: 7f478222ecc5871c1166c5a329720f92c890638369894bc6d32196b64fc0b2d0b06d79ee4b653d0b05b18c08abe302a2163024ab38c05cd1aa63e60c17746d67
6
+ metadata.gz: a59780e3bd62216fe2ee2fb7d77da686663cf55502fdd58a75defe37cd57859a7094d4054180eb33f284f8651488215ceb18ae20bc0844281d9ea20a9f8f368d
7
+ data.tar.gz: ff194f4bd0b0c82d90405fbd27e97ec2f0dcd099580cef15f28bedf307b80f25670004c26a54b2feecdf3c7e30856ef4af1917ac11dffee49e62e47ecc2b235c
data/Gemfile.lock CHANGED
@@ -1,23 +1,9 @@
1
- GIT
2
- remote: https://github.com/puppetlabs/packaging
3
- revision: 43e14adf3cc3756bb5a776db9bc245c685c11f71
4
- branch: 1.0.x
5
- specs:
6
- packaging (0.108.0)
7
- apt_stage_artifacts
8
- artifactory (~> 3)
9
- csv (= 3.1.5)
10
- google-cloud-storage
11
- googleauth
12
- rake (>= 12.3)
13
- release-metrics
14
-
15
1
  PATH
16
2
  remote: .
17
3
  specs:
18
- puppet (7.20.0)
4
+ puppet (7.22.0)
19
5
  CFPropertyList (~> 2.2)
20
- concurrent-ruby (~> 1.0)
6
+ concurrent-ruby (~> 1.0, < 1.2.0)
21
7
  deep_merge (~> 1.0)
22
8
  facter (>= 2.4.0, < 5)
23
9
  fast_gettext (>= 1.1, < 3)
@@ -28,7 +14,7 @@ PATH
28
14
  semantic_puppet (~> 1.0)
29
15
 
30
16
  GEM
31
- remote: https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/
17
+ remote: https://rubygems.org/
32
18
  specs:
33
19
  CFPropertyList (2.3.6)
34
20
  addressable (2.8.1)
@@ -48,13 +34,32 @@ GEM
48
34
  digest-crc (0.6.4)
49
35
  rake (>= 12.0.0, < 14.0.0)
50
36
  docopt (0.6.1)
51
- facter (4.2.12)
37
+ facter (4.2.14)
52
38
  hocon (~> 1.3)
53
39
  thor (>= 1.0.1, < 2.0)
54
- faraday (2.6.0)
55
- faraday-net_http (>= 2.0, < 3.1)
40
+ faraday (1.10.3)
41
+ faraday-em_http (~> 1.0)
42
+ faraday-em_synchrony (~> 1.0)
43
+ faraday-excon (~> 1.1)
44
+ faraday-httpclient (~> 1.0)
45
+ faraday-multipart (~> 1.0)
46
+ faraday-net_http (~> 1.0)
47
+ faraday-net_http_persistent (~> 1.0)
48
+ faraday-patron (~> 1.0)
49
+ faraday-rack (~> 1.0)
50
+ faraday-retry (~> 1.0)
56
51
  ruby2_keywords (>= 0.0.4)
57
- faraday-net_http (3.0.0)
52
+ faraday-em_http (1.0.0)
53
+ faraday-em_synchrony (1.0.0)
54
+ faraday-excon (1.1.0)
55
+ faraday-httpclient (1.0.1)
56
+ faraday-multipart (1.0.4)
57
+ multipart-post (~> 2)
58
+ faraday-net_http (1.0.1)
59
+ faraday-net_http_persistent (1.2.0)
60
+ faraday-patron (1.0.0)
61
+ faraday-rack (1.0.0)
62
+ faraday-retry (1.0.3)
58
63
  fast_gettext (1.1.2)
59
64
  ffi (1.15.5)
60
65
  gettext (3.2.9)
@@ -64,7 +69,7 @@ GEM
64
69
  fast_gettext (~> 1.1.0)
65
70
  gettext (>= 3.0.2, < 3.3.0)
66
71
  locale
67
- google-apis-core (0.9.0)
72
+ google-apis-core (0.9.5)
68
73
  addressable (~> 2.5, >= 2.5.1)
69
74
  googleauth (>= 0.16.2, < 2.a)
70
75
  httpclient (>= 2.8.1, < 3.a)
@@ -73,8 +78,8 @@ GEM
73
78
  retriable (>= 2.0, < 4.a)
74
79
  rexml
75
80
  webrick
76
- google-apis-iamcredentials_v1 (0.15.0)
77
- google-apis-core (>= 0.9.0, < 2.a)
81
+ google-apis-iamcredentials_v1 (0.16.0)
82
+ google-apis-core (>= 0.9.1, < 2.a)
78
83
  google-apis-storage_v1 (0.19.0)
79
84
  google-apis-core (>= 0.9.0, < 2.a)
80
85
  google-cloud-core (1.6.0)
@@ -83,7 +88,7 @@ GEM
83
88
  google-cloud-env (1.6.0)
84
89
  faraday (>= 0.17.3, < 3.0)
85
90
  google-cloud-errors (1.3.0)
86
- google-cloud-storage (1.43.0)
91
+ google-cloud-storage (1.44.0)
87
92
  addressable (~> 2.8)
88
93
  digest-crc (~> 0.4)
89
94
  google-apis-iamcredentials_v1 (~> 0.1)
@@ -91,7 +96,7 @@ GEM
91
96
  google-cloud-core (~> 1.6)
92
97
  googleauth (>= 0.16.2, < 2.a)
93
98
  mini_mime (~> 1.0)
94
- googleauth (1.2.0)
99
+ googleauth (1.1.3)
95
100
  faraday (>= 0.17.3, < 3.a)
96
101
  jwt (>= 1.4, < 3.0)
97
102
  memoist (~> 0.16)
@@ -99,45 +104,54 @@ GEM
99
104
  os (>= 0.9, < 2.0)
100
105
  signet (>= 0.16, < 2.a)
101
106
  hashdiff (1.0.1)
102
- hiera (3.10.0)
107
+ hiera (3.11.0)
103
108
  hiera-eyaml (3.3.0)
104
109
  highline
105
110
  optimist
106
- highline (2.0.3)
111
+ highline (2.1.0)
107
112
  hocon (1.3.1)
108
113
  hpricot (0.8.6)
109
114
  httpclient (2.8.3)
110
115
  json-schema (2.8.1)
111
116
  addressable (>= 2.4)
112
- jwt (2.5.0)
117
+ jwt (2.6.0)
113
118
  locale (2.1.3)
114
119
  memoist (0.16.2)
115
- memory_profiler (1.0.0)
120
+ memory_profiler (1.0.1)
116
121
  method_source (1.0.0)
117
122
  mini_mime (1.1.2)
118
123
  minitar (0.9)
119
124
  msgpack (1.6.0)
120
125
  multi_json (1.15.0)
126
+ multipart-post (2.2.3)
121
127
  mustache (1.1.1)
122
128
  optimist (3.0.1)
123
129
  os (1.1.4)
130
+ packaging (0.108.1)
131
+ apt_stage_artifacts
132
+ artifactory (~> 3)
133
+ csv (= 3.1.5)
134
+ google-cloud-storage
135
+ googleauth
136
+ rake (>= 12.3)
137
+ release-metrics
124
138
  parallel (1.22.1)
125
139
  parser (2.7.2.0)
126
140
  ast (~> 2.4.1)
127
141
  powerpack (0.1.3)
128
- pry (0.14.1)
142
+ pry (0.14.2)
129
143
  coderay (~> 1.1)
130
144
  method_source (~> 1.0)
131
- public_suffix (5.0.0)
145
+ public_suffix (4.0.7)
132
146
  puppet-resource_api (1.8.14)
133
147
  hocon (>= 1.0)
134
- puppetserver-ca (2.3.6)
148
+ puppetserver-ca (2.4.0)
135
149
  facter (>= 2.0.1, < 5)
136
150
  racc (1.5.2)
137
151
  rainbow (2.2.2)
138
152
  rake
139
153
  rake (13.0.6)
140
- rdiscount (2.2.0.2)
154
+ rdiscount (2.2.7)
141
155
  rdoc (6.3.3)
142
156
  release-metrics (1.1.0)
143
157
  csv
@@ -152,22 +166,22 @@ GEM
152
166
  hpricot (>= 0.8.2)
153
167
  mustache (>= 0.7.0)
154
168
  rdiscount (>= 1.5.8)
155
- rspec (3.11.0)
156
- rspec-core (~> 3.11.0)
157
- rspec-expectations (~> 3.11.0)
158
- rspec-mocks (~> 3.11.0)
159
- rspec-core (3.11.0)
160
- rspec-support (~> 3.11.0)
161
- rspec-expectations (3.11.1)
169
+ rspec (3.12.0)
170
+ rspec-core (~> 3.12.0)
171
+ rspec-expectations (~> 3.12.0)
172
+ rspec-mocks (~> 3.12.0)
173
+ rspec-core (3.12.0)
174
+ rspec-support (~> 3.12.0)
175
+ rspec-expectations (3.12.2)
162
176
  diff-lcs (>= 1.2.0, < 2.0)
163
- rspec-support (~> 3.11.0)
177
+ rspec-support (~> 3.12.0)
164
178
  rspec-its (1.3.0)
165
179
  rspec-core (>= 3.0.0)
166
180
  rspec-expectations (>= 3.0.0)
167
- rspec-mocks (3.11.1)
181
+ rspec-mocks (3.12.3)
168
182
  diff-lcs (>= 1.2.0, < 2.0)
169
- rspec-support (~> 3.11.0)
170
- rspec-support (3.11.1)
183
+ rspec-support (~> 3.12.0)
184
+ rspec-support (3.12.0)
171
185
  rubocop (0.49.1)
172
186
  parallel (~> 1.10)
173
187
  parser (>= 2.3.3.1, < 3.0)
@@ -182,9 +196,9 @@ GEM
182
196
  ruby2_keywords (0.0.5)
183
197
  scanf (1.0.0)
184
198
  semantic_puppet (1.0.4)
185
- signet (0.17.0)
199
+ signet (0.16.1)
186
200
  addressable (~> 2.8)
187
- faraday (>= 0.17.5, < 3.a)
201
+ faraday (>= 0.17.5, < 3.0)
188
202
  jwt (>= 1.5, < 3.0)
189
203
  multi_json (~> 1.10)
190
204
  text (1.3.1)
@@ -214,7 +228,7 @@ DEPENDENCIES
214
228
  memory_profiler
215
229
  minitar (~> 0.9)
216
230
  msgpack (~> 1.2)
217
- packaging!
231
+ packaging (~> 0.99)
218
232
  pry
219
233
  puppet!
220
234
  puppet-resource_api (~> 1.5)
data/Guardfile.example CHANGED
@@ -16,7 +16,7 @@ notification(:terminal_notifier, app_name: "Puppet ::", group: `pwd`.chomp) if `
16
16
 
17
17
  ## Uncomment and set this to only include directories you want to watch
18
18
  # directories %w(app lib config test spec features) \
19
- # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
19
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
20
20
 
21
21
  ## Note: if you are using the `directories` clause above and you are not
22
22
  ## watching the project directory ('.'), then you will want to move
@@ -25,7 +25,7 @@ gem_runtime_dependencies:
25
25
  locale: '~> 2.1'
26
26
  multi_json: '~> 1.10'
27
27
  puppet-resource_api: '~>1.5'
28
- concurrent-ruby: '~> 1.0'
28
+ concurrent-ruby: ["~> 1.0", "< 1.2.0"]
29
29
  deep_merge: '~> 1.0'
30
30
  scanf: '~> 1.0'
31
31
  gem_rdoc_options:
@@ -48,7 +48,7 @@ class WindowsDaemon < Puppet::Util::Windows::Daemon
48
48
  #
49
49
  # Example code to register an event source;
50
50
  # eventlogdll = File.expand_path(File.join(basedir, 'puppet', 'ext', 'windows', 'eventlog', 'puppetres.dll'))
51
- # if (File.exists?(eventlogdll))
51
+ # if (File.exist?(eventlogdll))
52
52
  # Win32::EventLog.add_event_source(
53
53
  # 'source' => "Application",
54
54
  # 'key_name' => "Puppet Agent",
@@ -376,9 +376,9 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
376
376
  facts = retrieve_node_facts(node, given_facts)
377
377
  ni = Puppet::Node.indirection
378
378
  tc = ni.terminus_class
379
- if options[:compile] && !Puppet.settings.set_by_cli?('environment')
379
+ if options[:compile]
380
380
  if tc == :plain
381
- node = ni.find(node, facts: facts)
381
+ node = ni.find(node, facts: facts, environment: Puppet[:environment])
382
382
  else
383
383
  begin
384
384
  service = Puppet.runtime[:http]
@@ -390,11 +390,11 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
390
390
  Puppet::SSL::Oids.register_puppet_oids
391
391
  trusted = Puppet::Context::TrustedInformation.remote(true, facts.values['certname'] || node, Puppet::SSL::Certificate.from_instance(cert))
392
392
  Puppet.override(trusted_information: trusted) do
393
- node = ni.find(node, facts: facts)
393
+ node = ni.find(node, facts: facts, environment: Puppet[:environment])
394
394
  end
395
395
  rescue
396
396
  Puppet.warning _("CA is not available, the operation will continue without using trusted facts.")
397
- node = ni.find(node, facts: facts)
397
+ node = ni.find(node, facts: facts, environment: Puppet[:environment])
398
398
  end
399
399
  end
400
400
  else
@@ -405,7 +405,7 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
405
405
  else
406
406
  node.add_extra_facts(given_facts) if given_facts
407
407
  end
408
-
408
+ node.environment = Puppet[:environment] if Puppet.settings.set_by_cli?(:environment)
409
409
  Puppet[:code] = 'undef' unless options[:compile]
410
410
  compiler = Puppet::Parser::Compiler.new(node)
411
411
  if options[:node]
@@ -1450,6 +1450,12 @@ EOT
1450
1450
 
1451
1451
  To turn off reports entirely, set this to `none`",
1452
1452
  },
1453
+ :exclude_unchanged_resources => {
1454
+ :default => false,
1455
+ :type => :boolean,
1456
+ :desc => 'When set to true, resources that have had no changes after catalog application
1457
+ will not have corresponding unchanged resource status updates listed in the report.'
1458
+ },
1453
1459
  :reportdir => {
1454
1460
  :default => "$vardir/reports",
1455
1461
  :type => :directory,
@@ -1712,6 +1718,14 @@ EOT
1712
1718
  new configurations, where you want to fix the broken configuration
1713
1719
  rather than reverting to a known-good one.",
1714
1720
  },
1721
+ :include_legacy_facts => {
1722
+ :type => :boolean,
1723
+ :default => true,
1724
+ :desc => "Whether to include legacy facts when requesting a catalog. This
1725
+ option can be set to false provided all puppet manifests, hiera.yaml and hiera
1726
+ configuration layers no longer access legacy facts, such as `$osfamily`, and
1727
+ instead access structured facts, such as `$facts['os']['family']`."
1728
+ },
1715
1729
  :fact_name_length_soft_limit => {
1716
1730
  :default => 2560,
1717
1731
  :type => :integer,
@@ -35,8 +35,15 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
35
35
  result = if request.options[:resolve_options]
36
36
  raise(Puppet::Error, _("puppet facts show requires version 4.0.40 or greater of Facter.")) unless Facter.respond_to?(:resolve)
37
37
  find_with_options(request)
38
- else
38
+ elsif Puppet[:include_legacy_facts]
39
+ # to_hash returns both structured and legacy facts
39
40
  Puppet::Node::Facts.new(request.key, Puppet.runtime[:facter].to_hash)
41
+ else
42
+ # resolve does not return legacy facts unless requested
43
+ facts = Puppet.runtime[:facter].resolve('')
44
+ # some versions of Facter 4 return a Facter::FactCollection instead of
45
+ # a Hash, breaking API compatibility, so force a hash using `to_h`
46
+ Puppet::Node::Facts.new(request.key, facts.to_h)
40
47
  end
41
48
 
42
49
  result.add_local_facts unless request.options[:resolve_options]
@@ -4,11 +4,19 @@ class Puppet::InfoService::TaskInformationService
4
4
  def self.tasks_per_environment(environment_name)
5
5
  # get the actual environment object, raise error if the named env doesn't exist
6
6
  env = Puppet.lookup(:environments).get!(environment_name)
7
+
7
8
  env.modules.map do |mod|
8
9
  mod.tasks.map do |task|
9
- {:module => {:name => task.module.name}, :name => task.name, :metadata => task.metadata}
10
+ # If any task is malformed continue to list other tasks in module
11
+ begin
12
+ task.validate
13
+ {:module => {:name => task.module.name}, :name => task.name, :metadata => task.metadata}
14
+ rescue Puppet::Module::Task::Error => err
15
+ Puppet.log_exception(err, 'Failed to validate task')
16
+ nil
17
+ end
10
18
  end
11
- end.flatten
19
+ end.flatten.compact
12
20
  end
13
21
 
14
22
  def self.task_data(environment_name, module_name, task_name)
@@ -38,6 +38,7 @@ class Puppet::Transaction::Report
38
38
  include Puppet::Util::PsychSupport
39
39
  extend Puppet::Indirector
40
40
 
41
+ STATES_FOR_EXCLUSION_FROM_REPORT = [:failed, :failed_to_restart, :out_of_sync, :skipped].freeze
41
42
  indirects :report, :terminus_class => :processor
42
43
 
43
44
  # The version of the configuration
@@ -308,6 +309,22 @@ class Puppet::Transaction::Report
308
309
  end
309
310
  end
310
311
 
312
+ def resource_unchanged?(rs)
313
+ STATES_FOR_EXCLUSION_FROM_REPORT.each do |state|
314
+ return false if rs.send(state)
315
+ end
316
+ true
317
+ end
318
+
319
+ def calculate_resource_statuses
320
+ resource_statuses = if Puppet[:exclude_unchanged_resources]
321
+ @resource_statuses.reject { |_key, rs| resource_unchanged?(rs) }
322
+ else
323
+ @resource_statuses
324
+ end
325
+ Hash[resource_statuses.map { |key, rs| [key, rs.nil? ? nil : rs.to_data_hash] }]
326
+ end
327
+
311
328
  def to_data_hash
312
329
  hash = {
313
330
  'host' => @host,
@@ -323,7 +340,7 @@ class Puppet::Transaction::Report
323
340
  'environment' => @environment,
324
341
  'logs' => @logs.map { |log| log.to_data_hash },
325
342
  'metrics' => Hash[@metrics.map { |key, metric| [key, metric.to_data_hash] }],
326
- 'resource_statuses' => Hash[@resource_statuses.map { |key, rs| [key, rs.nil? ? nil : rs.to_data_hash] }],
343
+ 'resource_statuses' => calculate_resource_statuses,
327
344
  'corrective_change' => @corrective_change,
328
345
  }
329
346
 
@@ -120,12 +120,7 @@ Puppet::Type.newtype(:resources) do
120
120
  select { |r| r.class.validproperty?(:ensure) }.
121
121
  select { |r| able_to_ensure_absent?(r) }.
122
122
  each { |resource|
123
- @parameters.each do |name, param|
124
- resource[name] = param.value if param.metaparam?
125
- end
126
-
127
- # Mark that we're purging, so transactions can handle relationships
128
- # correctly
123
+ resource.copy_metaparams(@parameters)
129
124
  resource.purging
130
125
  }
131
126
  end
@@ -247,9 +247,10 @@ Puppet::Type.newtype(:tidy) do
247
247
  :ensure => :absent, :force => true
248
248
  }
249
249
 
250
- parameters[:noop] = self[:noop] unless self[:noop].nil?
250
+ new_file = Puppet::Type.type(:file).new(parameters)
251
+ new_file.copy_metaparams(@parameters)
251
252
 
252
- Puppet::Type.type(:file).new(parameters)
253
+ new_file
253
254
  end
254
255
 
255
256
  def retrieve
@@ -811,9 +811,7 @@ module Puppet
811
811
  flatten.each do |res|
812
812
  res[:ensure] = :absent
813
813
  res[:user] = self[:name]
814
- @parameters.each do |name, param|
815
- res[name] = param.value if param.metaparam?
816
- end
814
+ res.copy_metaparams(@parameters)
817
815
  end
818
816
  end
819
817
 
data/lib/puppet/type.rb CHANGED
@@ -356,6 +356,16 @@ class Type
356
356
  param
357
357
  end
358
358
 
359
+ # Copies all of a resource's metaparameters (except `alias`) to a generated child resource
360
+ # @param parameters [Hash] of a resource's parameters
361
+ # @return [Void]
362
+ def copy_metaparams(parameters)
363
+ parameters.each do |name, param|
364
+ self[name] = param.value if param.metaparam? && name != :alias
365
+ end
366
+ nil
367
+ end
368
+
359
369
  # Returns the list of parameters that comprise the composite key / "uniqueness key".
360
370
  # All parameters that return true from #isnamevar? or is named `:name` are included in the returned result.
361
371
  # @see uniqueness_key
@@ -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.20.0'
9
+ PUPPETVERSION = '7.22.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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPETCONF" "5" "January 2023" "Puppet, Inc." "Puppet manual"
5
5
  \fBThis page is autogenerated; any changes will get overwritten\fR
6
6
  .
7
7
  .SH "Configuration settings"
@@ -647,6 +647,14 @@ Whether each resource should log when it is being evaluated\. This allows you to
647
647
  .
648
648
  .IP "" 0
649
649
  .
650
+ .SS "exclude_unchanged_resources"
651
+ When set to true, resources that have had no changes after catalog application will not have corresponding unchanged resource status updates listed in the report\.
652
+ .
653
+ .IP "\(bu" 4
654
+ \fIDefault\fR: \fBfalse\fR
655
+ .
656
+ .IP "" 0
657
+ .
650
658
  .SS "external_nodes"
651
659
  The external node classifier (ENC) script to use for node data\. Puppet combines this data with the main manifest to produce node catalogs\.
652
660
  .
@@ -929,7 +937,7 @@ The time to wait for data to be read from an HTTP connection\. If nothing is rea
929
937
  The HTTP User\-Agent string to send when making network requests\.
930
938
  .
931
939
  .IP "\(bu" 4
932
- \fIDefault\fR: \fBPuppet/7\.20\.0 Ruby/2\.7\.5\-p203 (x86_64\-linux)\fR
940
+ \fIDefault\fR: \fBPuppet/7\.22\.0 Ruby/2\.7\.5\-p203 (x86_64\-linux)\fR
933
941
  .
934
942
  .IP "" 0
935
943
  .
@@ -957,6 +965,14 @@ Boolean; whether puppet agent should ignore schedules\. This is useful for initi
957
965
  .
958
966
  .IP "" 0
959
967
  .
968
+ .SS "include_legacy_facts"
969
+ Whether to include legacy facts when requesting a catalog\. This option can be set to false provided all puppet manifests, hiera\.yaml and hiera configuration layers no longer access legacy facts, such as \fB$osfamily\fR, and instead access structured facts, such as \fB$facts[\'os\'][\'family\']\fR\.
970
+ .
971
+ .IP "\(bu" 4
972
+ \fIDefault\fR: \fBtrue\fR
973
+ .
974
+ .IP "" 0
975
+ .
960
976
  .SS "key_type"
961
977
  The type of private key\. Valid values are \fBrsa\fR and \fBec\fR\. Default is \fBrsa\fR\.
962
978
  .
@@ -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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-AGENT" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-APPLY" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CATALOG" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CONFIG" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DESCRIBE" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DEVICE" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DOC" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-EPP" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FACTS" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FILEBUCKET" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-GENERATE" "8" "January 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 2022" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-HELP" "8" "January 2023" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-help\fR \- Display Puppet help\.