chef 18.9.4 → 18.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +16 -12
- data/README.md +0 -1
- data/Rakefile +21 -5
- data/chef-universal-mingw-ucrt.gemspec +4 -2
- data/chef.gemspec +17 -14
- data/lib/chef/application/apply.rb +1 -1
- data/lib/chef/application/base.rb +4 -4
- data/lib/chef/application/exit_code.rb +1 -1
- data/lib/chef/chef_fs/command_line.rb +4 -4
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +2 -3
- data/lib/chef/client.rb +2 -3
- data/lib/chef/compliance/fetcher/chef_server.rb +1 -1
- data/lib/chef/compliance/reporter/cli.rb +2 -2
- data/lib/chef/compliance/runner.rb +19 -1
- data/lib/chef/dsl/chef_vault.rb +1 -1
- data/lib/chef/dsl/rest_resource.rb +223 -16
- data/lib/chef/encrypted_data_bag_item/decryptor.rb +1 -5
- data/lib/chef/environment.rb +1 -1
- data/lib/chef/exceptions.rb +1 -1
- data/lib/chef/file_cache.rb +1 -5
- data/lib/chef/formatters/error_description.rb +8 -1
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +1 -1
- data/lib/chef/group.rb +1 -1
- data/lib/chef/handler/slow_report.rb +1 -1
- data/lib/chef/http/authenticator.rb +25 -12
- data/lib/chef/mixin/api_version_request_handling.rb +1 -1
- data/lib/chef/mixin/powershell_type_coercions.rb +2 -2
- data/lib/chef/mixin/securable.rb +2 -2
- data/lib/chef/mixin/template.rb +25 -3
- data/lib/chef/mixin/versioned_api.rb +1 -1
- data/lib/chef/monkey_patches/net-http.rb +8 -8
- data/lib/chef/monkey_patches/reline-windows.rb +116 -0
- data/lib/chef/property.rb +1 -1
- data/lib/chef/provider/cron.rb +1 -1
- data/lib/chef/provider/directory.rb +11 -0
- data/lib/chef/provider/dsc_resource.rb +2 -2
- data/lib/chef/provider/file/content.rb +3 -2
- data/lib/chef/provider/file.rb +1 -1
- data/lib/chef/provider/git.rb +1 -1
- data/lib/chef/provider/ifconfig/debian.rb +1 -1
- data/lib/chef/provider/ifconfig/redhat.rb +1 -1
- data/lib/chef/provider/mount/linux.rb +1 -1
- data/lib/chef/provider/mount/windows.rb +4 -4
- data/lib/chef/provider/package/chocolatey.rb +78 -19
- data/lib/chef/provider/package/dnf/dnf_helper.py +355 -65
- data/lib/chef/provider/package/dnf/python_helper.rb +7 -4
- data/lib/chef/provider/package/dnf.rb +25 -6
- data/lib/chef/provider/package/homebrew.rb +3 -3
- data/lib/chef/provider/package/rubygems.rb +25 -2
- data/lib/chef/provider/package/snap.rb +1 -1
- data/lib/chef/provider/package/windows/exe.rb +1 -1
- data/lib/chef/provider/package/windows/msi.rb +1 -1
- data/lib/chef/provider/package/yum/rpm_utils.rb +2 -2
- data/lib/chef/provider/package/yum.rb +1 -1
- data/lib/chef/provider/powershell_script.rb +84 -84
- data/lib/chef/provider/service/debian.rb +2 -4
- data/lib/chef/provider/user/dscl.rb +1 -1
- data/lib/chef/provider/user/mac.rb +1 -1
- data/lib/chef/provider/windows_script.rb +1 -1
- data/lib/chef/resource/_rest_resource.rb +9 -7
- data/lib/chef/resource/alternatives.rb +41 -41
- data/lib/chef/resource/apt_package.rb +31 -31
- data/lib/chef/resource/apt_preference.rb +22 -22
- data/lib/chef/resource/apt_repository.rb +2 -2
- data/lib/chef/resource/archive_file.rb +52 -18
- data/lib/chef/resource/bash.rb +129 -129
- data/lib/chef/resource/bff_package.rb +15 -15
- data/lib/chef/resource/breakpoint.rb +44 -44
- data/lib/chef/resource/cab_package.rb +22 -22
- data/lib/chef/resource/chef_client_config.rb +251 -89
- data/lib/chef/resource/chef_client_cron.rb +18 -18
- data/lib/chef/resource/chef_client_launchd.rb +1 -1
- data/lib/chef/resource/chef_client_scheduled_task.rb +31 -31
- data/lib/chef/resource/chef_client_systemd_timer.rb +16 -16
- data/lib/chef/resource/chef_client_trusted_certificate.rb +28 -28
- data/lib/chef/resource/chef_handler.rb +107 -107
- data/lib/chef/resource/chef_vault_secret.rb +1 -1
- data/lib/chef/resource/chocolatey_config.rb +14 -14
- data/lib/chef/resource/chocolatey_feature.rb +1 -1
- data/lib/chef/resource/chocolatey_installer.rb +60 -42
- data/lib/chef/resource/chocolatey_package.rb +1 -1
- data/lib/chef/resource/chocolatey_source.rb +15 -15
- data/lib/chef/resource/cron/_cron_shared.rb +0 -2
- data/lib/chef/resource/cron/cron.rb +70 -70
- data/lib/chef/resource/csh.rb +5 -5
- data/lib/chef/resource/directory.rb +6 -6
- data/lib/chef/resource/dpkg_package.rb +3 -3
- data/lib/chef/resource/group.rb +28 -28
- data/lib/chef/resource/habitat/habitat_package.rb +80 -80
- data/lib/chef/resource/habitat/habitat_sup.rb +93 -95
- data/lib/chef/resource/habitat/habitat_sup_systemd.rb +10 -10
- data/lib/chef/resource/habitat/habitat_sup_windows.rb +3 -3
- data/lib/chef/resource/habitat_config.rb +13 -13
- data/lib/chef/resource/habitat_install.rb +17 -17
- data/lib/chef/resource/habitat_service.rb +1 -1
- data/lib/chef/resource/habitat_user_toml.rb +12 -12
- data/lib/chef/resource/helpers/cron_validations.rb +2 -2
- data/lib/chef/resource/homebrew_cask.rb +1 -1
- data/lib/chef/resource/homebrew_package.rb +20 -20
- data/lib/chef/resource/homebrew_tap.rb +1 -1
- data/lib/chef/resource/hostname.rb +2 -2
- data/lib/chef/resource/http_request.rb +2 -2
- data/lib/chef/resource/ifconfig.rb +34 -34
- data/lib/chef/resource/inspec_input.rb +37 -37
- data/lib/chef/resource/inspec_waiver.rb +63 -63
- data/lib/chef/resource/inspec_waiver_file_entry.rb +25 -25
- data/lib/chef/resource/ksh.rb +5 -5
- data/lib/chef/resource/launchd.rb +2 -2
- data/lib/chef/resource/link.rb +8 -8
- data/lib/chef/resource/locale.rb +6 -6
- data/lib/chef/resource/log.rb +4 -4
- data/lib/chef/resource/mdadm.rb +36 -36
- data/lib/chef/resource/mount.rb +3 -3
- data/lib/chef/resource/msu_package.rb +1 -1
- data/lib/chef/resource/ohai.rb +32 -32
- data/lib/chef/resource/ohai_hint.rb +24 -24
- data/lib/chef/resource/openssl_ec_private_key.rb +2 -2
- data/lib/chef/resource/openssl_ec_public_key.rb +2 -2
- data/lib/chef/resource/openssl_rsa_private_key.rb +1 -1
- data/lib/chef/resource/openssl_rsa_public_key.rb +2 -2
- data/lib/chef/resource/openssl_x509_certificate.rb +1 -1
- data/lib/chef/resource/openssl_x509_crl.rb +15 -15
- data/lib/chef/resource/openssl_x509_request.rb +2 -2
- data/lib/chef/resource/osx_profile.rb +54 -54
- data/lib/chef/resource/package.rb +6 -6
- data/lib/chef/resource/perl.rb +5 -5
- data/lib/chef/resource/plist.rb +4 -4
- data/lib/chef/resource/powershell_package_source.rb +12 -12
- data/lib/chef/resource/python.rb +4 -4
- data/lib/chef/resource/reboot.rb +5 -5
- data/lib/chef/resource/registry_key.rb +81 -81
- data/lib/chef/resource/remote_file.rb +72 -72
- data/lib/chef/resource/resource_notification.rb +4 -4
- data/lib/chef/resource/rhsm_errata_level.rb +1 -1
- data/lib/chef/resource/rhsm_register.rb +2 -2
- data/lib/chef/resource/scm/git.rb +79 -79
- data/lib/chef/resource/scm/subversion.rb +9 -9
- data/lib/chef/resource/script.rb +3 -3
- data/lib/chef/resource/selinux_boolean.rb +12 -12
- data/lib/chef/resource/selinux_fcontext.rb +21 -21
- data/lib/chef/resource/selinux_install.rb +18 -18
- data/lib/chef/resource/selinux_login.rb +11 -11
- data/lib/chef/resource/selinux_module.rb +16 -16
- data/lib/chef/resource/selinux_permissive.rb +9 -9
- data/lib/chef/resource/selinux_port.rb +16 -16
- data/lib/chef/resource/selinux_state.rb +28 -28
- data/lib/chef/resource/selinux_user.rb +14 -14
- data/lib/chef/resource/service.rb +5 -5
- data/lib/chef/resource/snap_package.rb +16 -16
- data/lib/chef/resource/ssh_known_hosts_entry.rb +10 -10
- data/lib/chef/resource/sudo.rb +68 -68
- data/lib/chef/resource/swap_file.rb +12 -12
- data/lib/chef/resource/sysctl.rb +42 -42
- data/lib/chef/resource/systemd_unit.rb +38 -38
- data/lib/chef/resource/timezone.rb +16 -16
- data/lib/chef/resource/user/mac_user.rb +3 -3
- data/lib/chef/resource/user.rb +6 -6
- data/lib/chef/resource/user_ulimit.rb +22 -22
- data/lib/chef/resource/windows_ad_join.rb +25 -25
- data/lib/chef/resource/windows_audit_policy.rb +34 -34
- data/lib/chef/resource/windows_auto_run.rb +8 -8
- data/lib/chef/resource/windows_certificate.rb +20 -20
- data/lib/chef/resource/windows_defender.rb +22 -22
- data/lib/chef/resource/windows_defender_exclusion.rb +17 -17
- data/lib/chef/resource/windows_env.rb +6 -6
- data/lib/chef/resource/windows_feature.rb +42 -42
- data/lib/chef/resource/windows_feature_dism.rb +8 -8
- data/lib/chef/resource/windows_feature_powershell.rb +20 -20
- data/lib/chef/resource/windows_firewall_profile.rb +28 -28
- data/lib/chef/resource/windows_firewall_rule.rb +47 -47
- data/lib/chef/resource/windows_font.rb +7 -7
- data/lib/chef/resource/windows_package.rb +59 -59
- data/lib/chef/resource/windows_pagefile.rb +29 -29
- data/lib/chef/resource/windows_path.rb +12 -12
- data/lib/chef/resource/windows_printer.rb +28 -28
- data/lib/chef/resource/windows_printer_port.rb +21 -21
- data/lib/chef/resource/windows_security_policy.rb +23 -23
- data/lib/chef/resource/windows_service.rb +108 -108
- data/lib/chef/resource/windows_share.rb +19 -19
- data/lib/chef/resource/windows_shortcut.rb +7 -7
- data/lib/chef/resource/windows_task.rb +105 -105
- data/lib/chef/resource/windows_uac.rb +14 -14
- data/lib/chef/resource/windows_update_settings.rb +27 -27
- data/lib/chef/resource/windows_user_privilege.rb +59 -59
- data/lib/chef/resource/windows_workgroup.rb +12 -12
- data/lib/chef/resource/yum_package.rb +1 -1
- data/lib/chef/resource/yum_repository.rb +36 -36
- data/lib/chef/resource.rb +1 -1
- data/lib/chef/resource_collection/resource_set.rb +2 -3
- data/lib/chef/resource_inspector.rb +1 -2
- data/lib/chef/run_context.rb +2 -2
- data/lib/chef/runner.rb +1 -1
- data/lib/chef/secret_fetcher/akeyless_vault.rb +0 -1
- data/lib/chef/secret_fetcher/hashi_vault.rb +0 -1
- data/lib/chef/shell/ext.rb +20 -20
- data/lib/chef/shell/shell_session.rb +1 -1
- data/lib/chef/shell.rb +7 -0
- data/lib/chef/version.rb +1 -1
- data/lib/chef/version_constraint.rb +1 -1
- data/lib/chef/win32/file/version_info.rb +1 -1
- metadata +63 -38
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf0beb126b5eeb735670c67b48e79aae54a6ba25760f99babf2468fe6ff78437
|
|
4
|
+
data.tar.gz: 99033f783a17e8870ccfc0f20ef3489cfed936f2882d7030beaf0d78971e8a85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3e593233b5da46f034602581455a9ee6d32eaf77a1bbcedc91fb17d5826081c139480192887fdb3804cda29862383fe46fa74bae56af7947096d0adc42493e8
|
|
7
|
+
data.tar.gz: d80743280c5469a1c869fe02cce993d0649fdfecf6a3ca8a66892465b5b3239aba64378579c659800122aeb408745efd11712ff6dddb46b75d92ac000a36dc30
|
data/Gemfile
CHANGED
|
@@ -7,7 +7,7 @@ gem "ohai", git: "https://github.com/chef/ohai.git", branch: "18-stable"
|
|
|
7
7
|
# Nwed to file a bug with rest-client. In the meantime, we can use this until they accept the update.
|
|
8
8
|
gem "rest-client", git: "https://github.com/chef/rest-client", branch: "jfm/ucrt_update1"
|
|
9
9
|
|
|
10
|
-
gem "ffi", ">= 1.15.5", "<= 1.
|
|
10
|
+
gem "ffi", ">= 1.15.5", "<= 1.18.0"
|
|
11
11
|
gem "chef-utils", path: File.expand_path("chef-utils", __dir__) if File.exist?(File.expand_path("chef-utils", __dir__))
|
|
12
12
|
gem "chef-config", path: File.expand_path("chef-config", __dir__) if File.exist?(File.expand_path("chef-config", __dir__))
|
|
13
13
|
|
|
@@ -31,15 +31,19 @@ group(:omnibus_package) do
|
|
|
31
31
|
gem "rb-readline"
|
|
32
32
|
gem "chef-vault"
|
|
33
33
|
|
|
34
|
-
gem "inspec-core-bin", "
|
|
34
|
+
gem "inspec-core-bin", "~> 5.24", "< 6"
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
group(:omnibus_package, :pry) do
|
|
38
38
|
# Locked because pry-byebug is broken with 13+.
|
|
39
39
|
# some work is ongoing? https://github.com/deivid-rodriguez/pry-byebug/issues/343
|
|
40
|
-
gem "pry", "
|
|
41
|
-
# byebug does not install on freebsd on ruby 3.0
|
|
42
|
-
|
|
40
|
+
gem "pry", "0.15.2"
|
|
41
|
+
# byebug does not install on freebsd on ruby 3.0; byebug >= 12 requires ruby >= 3.1
|
|
42
|
+
# which is incompatible with the AIX omnibus toolchain (ruby 3.0.3)
|
|
43
|
+
unless RUBY_PLATFORM.match?(/freebsd|aix/i)
|
|
44
|
+
gem "byebug", "< 13"
|
|
45
|
+
gem "pry-byebug", "< 3.12"
|
|
46
|
+
end
|
|
43
47
|
gem "pry-stack_explorer"
|
|
44
48
|
end
|
|
45
49
|
|
|
@@ -60,18 +64,18 @@ group(:development, :test) do
|
|
|
60
64
|
gem "rake", ">= 12.3.3"
|
|
61
65
|
gem "rspec"
|
|
62
66
|
gem "webmock"
|
|
63
|
-
gem "crack", "< 0.
|
|
67
|
+
gem "crack", "< 1.0.2" # due to https://github.com/jnunemaker/crack/pull/75
|
|
64
68
|
gem "fauxhai-ng" # for chef-utils gem
|
|
65
69
|
end
|
|
66
70
|
|
|
67
|
-
gem "
|
|
68
|
-
# group(:chefstyle) do
|
|
69
|
-
# # for testing new chefstyle rules
|
|
70
|
-
# gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "main"
|
|
71
|
-
# end
|
|
71
|
+
gem "cookstyle", "~> 8.6"
|
|
72
72
|
|
|
73
73
|
instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]
|
|
74
74
|
|
|
75
75
|
# If you want to load debugging tools into the bundle exec sandbox,
|
|
76
76
|
# add these additional dependencies into Gemfile.local
|
|
77
|
-
|
|
77
|
+
#
|
|
78
|
+
# But doing eval_gemfile("./Gemfile.local") breaks dependabot, so a
|
|
79
|
+
# bit of indirection here
|
|
80
|
+
local_gemfile = File.join(__dir__, "Gemfile.local")
|
|
81
|
+
eval(File.read(local_gemfile)) if File.exist?(local_gemfile)
|
data/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# Chef Infra
|
|
2
|
-
[](https://codeclimate.com/github/chef/chef)
|
|
3
2
|
[](https://buildkite.com/chef-oss/chef-chef-main-verify)
|
|
4
3
|
[](https://badge.fury.io/rb/chef)
|
|
5
4
|
[](https://github.com/chef/chef/blob/main/docs/dev/design_documents/client_release_cadence.md)
|
data/Rakefile
CHANGED
|
@@ -100,12 +100,28 @@ task :register_eventlog do
|
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
desc "Check Linting and code style."
|
|
104
|
+
task :style do
|
|
105
105
|
require "rubocop/rake_task"
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
require "cookstyle/chefstyle"
|
|
107
|
+
|
|
108
|
+
if RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
|
|
109
|
+
# Windows-specific command, rubocop erroneously reports the CRLF in each file which is removed when your PR is uploaded to GitHub.
|
|
110
|
+
# This is a workaround to ignore the CRLF from the files before running cookstyle.
|
|
111
|
+
sh "cookstyle --chefstyle -c .rubocop.yml --except Layout/EndOfLine"
|
|
112
|
+
else
|
|
113
|
+
sh "cookstyle --chefstyle -c .rubocop.yml"
|
|
108
114
|
end
|
|
109
115
|
rescue LoadError
|
|
110
|
-
puts "
|
|
116
|
+
puts "Rubocop or Cookstyle gems are not installed. bundle install first to make sure all dependencies are installed."
|
|
111
117
|
end
|
|
118
|
+
|
|
119
|
+
# begin
|
|
120
|
+
# require "chefstyle"
|
|
121
|
+
# require "rubocop/rake_task"
|
|
122
|
+
# RuboCop::RakeTask.new(:style) do |task|
|
|
123
|
+
# task.options += ["--display-cop-names", "--no-color"]
|
|
124
|
+
# end
|
|
125
|
+
# rescue LoadError
|
|
126
|
+
# puts "chefstyle/rubocop is not available. bundle install first to make sure all dependencies are installed."
|
|
127
|
+
# end
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# rubocop:disable Chef/Ruby/GemspecLicense
|
|
2
|
+
# License is in the included gemspec.
|
|
3
|
+
gemspec = Gem::Specification.load(File.expand_path("chef.gemspec", __dir__))
|
|
2
4
|
|
|
3
5
|
gemspec.platform = Gem::Platform.new(%w{universal mingw-ucrt})
|
|
4
6
|
|
|
@@ -6,7 +8,7 @@ gemspec.add_dependency "win32-api", "~> 1.10.0"
|
|
|
6
8
|
gemspec.add_dependency "win32-event", "~> 0.6.1"
|
|
7
9
|
# TODO: Relax this pin and make the necessary updaets. The issue originally
|
|
8
10
|
# leading to this pin has been fixed in 0.6.5.
|
|
9
|
-
gemspec.add_dependency "win32-eventlog", "0.6.
|
|
11
|
+
gemspec.add_dependency "win32-eventlog", "0.6.7"
|
|
10
12
|
gemspec.add_dependency "win32-mmap", "~> 0.4.1"
|
|
11
13
|
gemspec.add_dependency "win32-mutex", "~> 0.4.2"
|
|
12
14
|
gemspec.add_dependency "win32-process", "~> 0.9"
|
data/chef.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# on Windows, the directory location starts with "(eval at " because it's
|
|
2
2
|
# being evaled in
|
|
3
|
-
file_directory = File.dirname(__FILE__).gsub(
|
|
3
|
+
file_directory = File.dirname(__FILE__).gsub("(eval at ", "")
|
|
4
4
|
$:.unshift(File.join(file_directory, "lib"))
|
|
5
5
|
vs_path = File.expand_path("chef-utils/lib/chef-utils/version_string.rb", __dir__)
|
|
6
6
|
|
|
@@ -25,16 +25,17 @@ Gem::Specification.new do |s|
|
|
|
25
25
|
s.email = "adam@chef.io"
|
|
26
26
|
s.homepage = "https://www.chef.io"
|
|
27
27
|
|
|
28
|
+
# help dependabot by specifying a default. If the default is in
|
|
29
|
+
# the 'else', dependabot misses it and falls back to a very old ruby
|
|
30
|
+
s.required_ruby_version = ">= 3.1.0"
|
|
28
31
|
if RUBY_PLATFORM =~ /aix/
|
|
29
32
|
s.required_ruby_version = ">= 3.0.3"
|
|
30
|
-
else
|
|
31
|
-
s.required_ruby_version = ">= 3.1.0"
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
s.add_dependency "chef-config", "= #{Chef::VERSION}"
|
|
35
36
|
s.add_dependency "chef-utils", "= #{Chef::VERSION}"
|
|
36
37
|
s.add_dependency "train-core", "~> 3.13", ">= 3.13.4"
|
|
37
|
-
s.add_dependency "train-winrm", "~> 0.
|
|
38
|
+
s.add_dependency "train-winrm", "~> 0.4.0"
|
|
38
39
|
s.add_dependency "train-rest", ">= 0.4.1" # target mode with rest APIs
|
|
39
40
|
|
|
40
41
|
s.add_dependency "license-acceptance", ">= 1.0.5", "< 3"
|
|
@@ -47,35 +48,37 @@ Gem::Specification.new do |s|
|
|
|
47
48
|
|
|
48
49
|
# AIX Gemfile.aix.lock uses this, but currently a manual process
|
|
49
50
|
if RUBY_PLATFORM.include?("aix") || ENV["GENERATE_AIX"] == "true"
|
|
50
|
-
s.add_dependency "inspec-core", ">= 5", "
|
|
51
|
+
s.add_dependency "inspec-core", ">= 5", "< 8"
|
|
51
52
|
else
|
|
52
|
-
s.add_dependency "inspec-core", ">= 5", "<
|
|
53
|
+
s.add_dependency "inspec-core", ">= 5", "< 8"
|
|
53
54
|
end
|
|
54
55
|
|
|
55
56
|
s.add_dependency "ffi", ">= 1.15.5", "<= 1.16.3"
|
|
56
|
-
s.add_dependency "ffi-yajl", "
|
|
57
|
+
s.add_dependency "ffi-yajl", ">= 2.2", "< 4.0"
|
|
57
58
|
s.add_dependency "net-sftp", ">= 2.1.2", "< 5.0" # remote_file resource
|
|
58
59
|
s.add_dependency "net-ftp" # remote_file resource
|
|
59
60
|
s.add_dependency "erubis", "~> 2.7" # template resource / cookbook syntax check
|
|
60
|
-
s.add_dependency "diff-lcs", ">= 1.2.4", "!= 1.4.0", "< 1.
|
|
61
|
+
s.add_dependency "diff-lcs", ">= 1.2.4", "!= 1.4.0", "< 2.1.0" # 1.4 breaks output. Used in lib/chef/util/diff
|
|
61
62
|
s.add_dependency "ffi-libarchive", "~> 1.0", ">= 1.0.3" # archive_file resource
|
|
62
|
-
s.add_dependency "chef-zero", "
|
|
63
|
+
s.add_dependency "chef-zero", "~> 15.1.11"
|
|
63
64
|
s.add_dependency "chef-vault" # chef-vault resources and helpers
|
|
64
65
|
|
|
65
66
|
s.add_dependency "plist", "~> 3.2" # launchd, dscl/mac user, macos_userdefaults, osx_profile and plist resources
|
|
66
67
|
s.add_dependency "iniparse", "~> 1.4" # systemd_unit resource
|
|
67
68
|
s.add_dependency "addressable"
|
|
68
69
|
s.add_dependency "syslog-logger", "~> 1.6"
|
|
69
|
-
s.add_dependency "uuidtools", ">= 2.1.5", "<
|
|
70
|
-
s.add_dependency "unf_ext", "
|
|
71
|
-
s.add_dependency "uri", "
|
|
70
|
+
s.add_dependency "uuidtools", ">= 2.1.5", "< 4.0" # osx_profile resource
|
|
71
|
+
s.add_dependency "unf_ext", ">= 0.0.8.2", "< 0.0.10.0" # older platforms
|
|
72
|
+
s.add_dependency "uri", ">= 1.0.4", "< 1.2.0" # This is used by net-http. We are forcing a version to get past a CVE in 1.0.2
|
|
72
73
|
s.add_dependency "corefoundation", "~> 0.3.4" # macos_userdefaults resource
|
|
73
74
|
|
|
74
75
|
s.add_dependency "proxifier2", "~> 1.1"
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
# 1.219 depends (transitively) on bigdecimal 4.1.2 which dodesn't compile
|
|
78
|
+
# on CentOS7
|
|
79
|
+
s.add_dependency "aws-sdk-s3", ">= 1.218.0", "< 1.219.0"
|
|
77
80
|
s.add_dependency "aws-sdk-secretsmanager", "~> 1.46"
|
|
78
|
-
s.add_dependency "vault", "
|
|
81
|
+
s.add_dependency "vault", ">= 0.18.2", "< 0.21.0" # hashi vault official client gem
|
|
79
82
|
|
|
80
83
|
s.bindir = "bin"
|
|
81
84
|
s.executables = %w{ }
|
|
@@ -75,7 +75,7 @@ class Chef::Application::Apply < Chef::Application
|
|
|
75
75
|
short: "-l LEVEL",
|
|
76
76
|
long: "--log_level LEVEL",
|
|
77
77
|
description: "Set the log level (trace, debug, info, warn, error, fatal).",
|
|
78
|
-
proc: lambda
|
|
78
|
+
proc: lambda(&:to_sym)
|
|
79
79
|
|
|
80
80
|
option :log_location_cli,
|
|
81
81
|
short: "-L LOGLOCATION",
|
|
@@ -96,7 +96,7 @@ class Chef::Application::Base < Chef::Application
|
|
|
96
96
|
short: "-l LEVEL",
|
|
97
97
|
long: "--log_level LEVEL",
|
|
98
98
|
description: "Set the log level (auto, trace, debug, info, warn, error, fatal).",
|
|
99
|
-
proc: lambda
|
|
99
|
+
proc: lambda(&:to_sym)
|
|
100
100
|
|
|
101
101
|
option :log_location_cli,
|
|
102
102
|
short: "-L LOGLOCATION",
|
|
@@ -139,7 +139,7 @@ class Chef::Application::Base < Chef::Application
|
|
|
139
139
|
short: "-i SECONDS",
|
|
140
140
|
long: "--interval SECONDS",
|
|
141
141
|
description: "Run #{ChefUtils::Dist::Infra::PRODUCT} periodically, in seconds.",
|
|
142
|
-
proc: lambda
|
|
142
|
+
proc: lambda(&:to_i)
|
|
143
143
|
|
|
144
144
|
option :json_attribs,
|
|
145
145
|
short: "-j JSON_ATTRIBS",
|
|
@@ -157,7 +157,7 @@ class Chef::Application::Base < Chef::Application
|
|
|
157
157
|
short: "-s SECONDS",
|
|
158
158
|
long: "--splay SECONDS",
|
|
159
159
|
description: "The splay time for running at intervals, in seconds.",
|
|
160
|
-
proc: lambda
|
|
160
|
+
proc: lambda(&:to_i)
|
|
161
161
|
|
|
162
162
|
option :environment,
|
|
163
163
|
short: "-E ENVIRONMENT",
|
|
@@ -189,7 +189,7 @@ class Chef::Application::Base < Chef::Application
|
|
|
189
189
|
option :run_lock_timeout,
|
|
190
190
|
long: "--run-lock-timeout SECONDS",
|
|
191
191
|
description: "Set maximum duration to wait for another client run to finish, default is indefinitely.",
|
|
192
|
-
proc: lambda
|
|
192
|
+
proc: lambda(&:to_i)
|
|
193
193
|
|
|
194
194
|
option :version,
|
|
195
195
|
short: "-v",
|
|
@@ -141,7 +141,7 @@ class Chef
|
|
|
141
141
|
def non_standard_exit_code_warning(exit_code)
|
|
142
142
|
"#{ChefUtils::Dist::Infra::CLIENT} attempted to exit with a non-standard exit code of #{exit_code}." \
|
|
143
143
|
" The #{ChefUtils::Dist::Infra::PRODUCT} Exit Codes design document (https://github.com/chef/chef/blob/main/docs/dev/design_documents/client_exit_codes.md)" \
|
|
144
|
-
" defines the exit codes that should be used with #{ChefUtils::Dist::Infra::CLIENT}. Chef::Application::ExitCode defines"
|
|
144
|
+
" defines the exit codes that should be used with #{ChefUtils::Dist::Infra::CLIENT}. Chef::Application::ExitCode defines" \
|
|
145
145
|
" valid exit codes Non-standard exit codes are redefined as GENERIC_FAILURE."
|
|
146
146
|
end
|
|
147
147
|
|
|
@@ -29,7 +29,7 @@ class Chef
|
|
|
29
29
|
|
|
30
30
|
def self.diff_print(pattern, a_root, b_root, recurse_depth, output_mode, format_path = nil, diff_filter = nil, ui = nil)
|
|
31
31
|
if format_path.nil?
|
|
32
|
-
format_path = proc
|
|
32
|
+
format_path = proc(&:path_for_printing)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
get_content = (output_mode != :name_only && output_mode != :name_status)
|
|
@@ -119,9 +119,9 @@ class Chef
|
|
|
119
119
|
yield result
|
|
120
120
|
end
|
|
121
121
|
|
|
122
|
-
when :both_nonexistent
|
|
123
|
-
when :added_cannot_upload
|
|
124
|
-
when :deleted_cannot_download
|
|
122
|
+
when :both_nonexistent # rubocop:disable Lint/EmptyWhen
|
|
123
|
+
when :added_cannot_upload # rubocop:disable Lint/EmptyWhen
|
|
124
|
+
when :deleted_cannot_download # rubocop:disable Lint/EmptyWhen
|
|
125
125
|
when :same
|
|
126
126
|
# Skip these silently
|
|
127
127
|
when :error
|
|
@@ -80,9 +80,8 @@ class Chef
|
|
|
80
80
|
tmp_cl.load_cookbooks
|
|
81
81
|
tmp_cl.compile_metadata
|
|
82
82
|
tmp_cl.freeze_versions if options[:freeze]
|
|
83
|
-
cookbook_for_upload =
|
|
84
|
-
|
|
85
|
-
cookbook_for_upload << cookbook
|
|
83
|
+
cookbook_for_upload = tmp_cl.map do |cookbook_name, cookbook|
|
|
84
|
+
cookbook
|
|
86
85
|
end
|
|
87
86
|
|
|
88
87
|
uploader = Chef::CookbookUploader.new(cookbook_for_upload, force: options[:force], rest: chef_rest)
|
data/lib/chef/client.rb
CHANGED
|
@@ -385,7 +385,7 @@ class Chef
|
|
|
385
385
|
# @api private
|
|
386
386
|
def rest
|
|
387
387
|
@rest ||= Chef::ServerAPI.new(Chef::Config[:chef_server_url], client_name: node_name,
|
|
388
|
-
|
|
388
|
+
signing_key_filename: Chef::Config[:client_key])
|
|
389
389
|
end
|
|
390
390
|
|
|
391
391
|
# A rest object with validate_utf8 set to false. This will not throw exceptions
|
|
@@ -397,7 +397,7 @@ class Chef
|
|
|
397
397
|
def rest_clean
|
|
398
398
|
@rest_clean ||=
|
|
399
399
|
Chef::ServerAPI.new(Chef::Config[:chef_server_url], client_name: node_name,
|
|
400
|
-
|
|
400
|
+
signing_key_filename: Chef::Config[:client_key], validate_utf8: false)
|
|
401
401
|
end
|
|
402
402
|
|
|
403
403
|
#
|
|
@@ -1090,4 +1090,3 @@ end
|
|
|
1090
1090
|
require_relative "cookbook_loader"
|
|
1091
1091
|
require_relative "cookbook_version"
|
|
1092
1092
|
require_relative "cookbook/synchronizer"
|
|
1093
|
-
|
|
@@ -125,7 +125,7 @@ class Chef
|
|
|
125
125
|
private
|
|
126
126
|
|
|
127
127
|
def chef_server_url
|
|
128
|
-
m = %r{^#{@config[
|
|
128
|
+
m = %r{^#{@config["server"]}/owners/(?<owner>[^/]+)/compliance/(?<id>[^/]+)/tar$}.match(@target)
|
|
129
129
|
"#{m[:owner]}/#{m[:id]}"
|
|
130
130
|
end
|
|
131
131
|
end
|
|
@@ -46,11 +46,11 @@ class Chef
|
|
|
46
46
|
end
|
|
47
47
|
if result[:message]
|
|
48
48
|
if found
|
|
49
|
-
result[:message].split(
|
|
49
|
+
result[:message].split("\n").reject(&:empty?).each do |m|
|
|
50
50
|
output << pastel.red("#{" " * 12}#{m}")
|
|
51
51
|
end
|
|
52
52
|
else
|
|
53
|
-
result[:message].split(
|
|
53
|
+
result[:message].split("\n").reject(&:empty?).each do |m|
|
|
54
54
|
output << pastel.red("#{" " * 9}#{m}")
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -72,14 +72,32 @@ class Chef
|
|
|
72
72
|
logger.debug("#{self.class}##{__method__}: enabling Compliance Phase")
|
|
73
73
|
|
|
74
74
|
report_with_interval
|
|
75
|
+
@compliance_phase_completed = true
|
|
75
76
|
end
|
|
76
77
|
|
|
77
|
-
def run_failed(
|
|
78
|
+
def run_failed(exception, _run_status)
|
|
78
79
|
# If the run has failed because our own validation of compliance
|
|
79
80
|
# phase configuration has failed, we don't want to submit a report
|
|
80
81
|
# because we're still not configured correctly.
|
|
81
82
|
return unless enabled? && @validation_passed
|
|
82
83
|
|
|
84
|
+
# A reboot exception is not a real failure — it is an expected outcome
|
|
85
|
+
# when a reboot resource fires :reboot_now. In that case run_completed
|
|
86
|
+
# has already executed the Compliance Phase, so running it again here
|
|
87
|
+
# would produce a duplicate scan (and the second scan may be killed by
|
|
88
|
+
# the pending reboot).
|
|
89
|
+
if exception.is_a?(Chef::Exceptions::Reboot)
|
|
90
|
+
logger.debug("#{self.class}##{__method__}: skipping Compliance Phase because a reboot was requested")
|
|
91
|
+
return
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Guard against any other code path that might trigger both run_completed
|
|
95
|
+
# and run_failed in the same client run.
|
|
96
|
+
if @compliance_phase_completed
|
|
97
|
+
logger.debug("#{self.class}##{__method__}: skipping Compliance Phase because it has already run in this client run")
|
|
98
|
+
return
|
|
99
|
+
end
|
|
100
|
+
|
|
83
101
|
logger.debug("#{self.class}##{__method__}: enabling Compliance Phase")
|
|
84
102
|
|
|
85
103
|
report_with_interval
|
data/lib/chef/dsl/chef_vault.rb
CHANGED