chef 18.5.0 → 18.7.3
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 +11 -6
- data/chef-universal-mingw-ucrt.gemspec +1 -1
- data/chef.gemspec +19 -15
- data/lib/chef/application/client.rb +0 -12
- data/lib/chef/client.rb +1 -10
- data/lib/chef/compliance/default_attributes.rb +2 -2
- data/lib/chef/compliance/runner.rb +6 -11
- data/lib/chef/cookbook/metadata.rb +1 -1
- data/lib/chef/cookbook/remote_file_vendor.rb +1 -3
- data/lib/chef/cookbook/synchronizer.rb +0 -5
- data/lib/chef/event_dispatch/dispatcher.rb +0 -1
- data/lib/chef/exceptions.rb +1 -1
- data/lib/chef/file_access_control/unix.rb +9 -9
- data/lib/chef/file_content_management/deploy.rb +1 -4
- data/lib/chef/mixin/file_class.rb +1 -3
- data/lib/chef/mixin/get_source_from_package.rb +1 -1
- data/lib/chef/mixin/{homebrew_user.rb → homebrew.rb} +13 -16
- data/lib/chef/mixin/openssl_helper.rb +1 -12
- data/lib/chef/provider/cookbook_file.rb +1 -1
- data/lib/chef/provider/cron.rb +1 -1
- data/lib/chef/provider/directory.rb +15 -15
- data/lib/chef/provider/file.rb +29 -42
- data/lib/chef/provider/git.rb +8 -8
- data/lib/chef/provider/group/aix.rb +1 -1
- data/lib/chef/provider/group/dscl.rb +1 -1
- data/lib/chef/provider/group/gpasswd.rb +2 -2
- data/lib/chef/provider/group/groupadd.rb +1 -1
- data/lib/chef/provider/group/groupmod.rb +2 -2
- data/lib/chef/provider/group/pw.rb +2 -2
- data/lib/chef/provider/group/solaris.rb +2 -2
- data/lib/chef/provider/group/usermod.rb +2 -2
- data/lib/chef/provider/group.rb +1 -1
- data/lib/chef/provider/http_request.rb +3 -2
- data/lib/chef/provider/ifconfig/aix.rb +1 -1
- data/lib/chef/provider/ifconfig/debian.rb +3 -3
- data/lib/chef/provider/ifconfig/redhat.rb +1 -1
- data/lib/chef/provider/ifconfig.rb +1 -1
- data/lib/chef/provider/link.rb +10 -10
- data/lib/chef/provider/mount/aix.rb +4 -4
- data/lib/chef/provider/mount/linux.rb +4 -4
- data/lib/chef/provider/mount/mount.rb +11 -11
- data/lib/chef/provider/package/apt.rb +11 -2
- data/lib/chef/provider/package/bff.rb +3 -3
- data/lib/chef/provider/package/chocolatey.rb +2 -2
- data/lib/chef/provider/package/dnf/dnf_helper.py +7 -0
- data/lib/chef/provider/package/dpkg.rb +3 -3
- data/lib/chef/provider/package/freebsd/base.rb +1 -1
- data/lib/chef/provider/package/habitat.rb +3 -5
- data/lib/chef/provider/package/homebrew.rb +6 -9
- data/lib/chef/provider/package/ips.rb +2 -2
- data/lib/chef/provider/package/openbsd.rb +2 -3
- data/lib/chef/provider/package/pacman.rb +4 -4
- data/lib/chef/provider/package/paludis.rb +2 -2
- data/lib/chef/provider/package/portage.rb +1 -1
- data/lib/chef/provider/package/rpm.rb +2 -2
- data/lib/chef/provider/package/rubygems.rb +4 -0
- data/lib/chef/provider/package/smartos.rb +2 -2
- data/lib/chef/provider/package/snap.rb +2 -2
- data/lib/chef/provider/package/solaris.rb +4 -4
- data/lib/chef/provider/package/zypper.rb +4 -4
- data/lib/chef/provider/package.rb +1 -1
- data/lib/chef/provider/registry_key.rb +6 -0
- data/lib/chef/provider/remote_directory.rb +5 -5
- data/lib/chef/provider/remote_file/http.rb +3 -2
- data/lib/chef/provider/remote_file.rb +1 -1
- data/lib/chef/provider/route.rb +9 -9
- data/lib/chef/provider/service/aix.rb +1 -1
- data/lib/chef/provider/service/aixinit.rb +4 -4
- data/lib/chef/provider/service/arch.rb +6 -6
- data/lib/chef/provider/service/debian.rb +5 -5
- data/lib/chef/provider/service/freebsd.rb +7 -7
- data/lib/chef/provider/service/gentoo.rb +5 -5
- data/lib/chef/provider/service/init.rb +2 -2
- data/lib/chef/provider/service/insserv.rb +2 -2
- data/lib/chef/provider/service/invokercd.rb +1 -1
- data/lib/chef/provider/service/openbsd.rb +7 -7
- data/lib/chef/provider/service/redhat.rb +3 -3
- data/lib/chef/provider/service/solaris.rb +2 -2
- data/lib/chef/provider/service/systemd.rb +2 -2
- data/lib/chef/provider/service/upstart.rb +2 -2
- data/lib/chef/provider/subversion.rb +8 -8
- data/lib/chef/provider/systemd_unit.rb +3 -3
- data/lib/chef/provider/template.rb +1 -1
- data/lib/chef/provider/user/aix.rb +3 -3
- data/lib/chef/provider/user/linux.rb +2 -7
- data/lib/chef/provider/user/pw.rb +3 -3
- data/lib/chef/provider/user/solaris.rb +7 -7
- data/lib/chef/provider/user/windows.rb +5 -0
- data/lib/chef/provider/user.rb +8 -7
- data/lib/chef/provider/yum_repository.rb +3 -1
- data/lib/chef/provider/zypper_repository.rb +1 -1
- data/lib/chef/providers.rb +0 -1
- data/lib/chef/resource/alternatives.rb +2 -2
- data/lib/chef/resource/apt_preference.rb +1 -1
- data/lib/chef/resource/apt_repository.rb +90 -15
- data/lib/chef/resource/apt_update.rb +3 -3
- data/lib/chef/resource/bff_package.rb +1 -1
- data/lib/chef/resource/chef_client_config.rb +3 -2
- data/lib/chef/resource/chef_sleep.rb +1 -1
- data/lib/chef/resource/cookbook_file.rb +1 -1
- data/lib/chef/resource/cron/cron.rb +1 -1
- data/lib/chef/resource/cron/cron_d.rb +1 -1
- data/lib/chef/resource/cron_access.rb +1 -1
- data/lib/chef/resource/directory.rb +1 -1
- data/lib/chef/resource/dpkg_package.rb +1 -1
- data/lib/chef/resource/file/verification/json.rb +1 -1
- data/lib/chef/resource/file/verification/systemd_unit.rb +1 -1
- data/lib/chef/resource/file/verification/yaml.rb +1 -1
- data/lib/chef/resource/file.rb +1 -1
- data/lib/chef/resource/freebsd_package.rb +2 -2
- data/lib/chef/resource/group.rb +1 -1
- data/lib/chef/resource/habitat/habitat_package.rb +1 -1
- data/lib/chef/resource/habitat/habitat_sup.rb +9 -9
- data/lib/chef/resource/habitat/habitat_sup_systemd.rb +2 -2
- data/lib/chef/resource/habitat_install.rb +3 -3
- data/lib/chef/resource/homebrew_cask.rb +19 -30
- data/lib/chef/resource/homebrew_tap.rb +32 -17
- data/lib/chef/resource/homebrew_update.rb +4 -4
- data/lib/chef/resource/hostname.rb +10 -11
- data/lib/chef/resource/http_request.rb +1 -1
- data/lib/chef/resource/ifconfig.rb +1 -1
- data/lib/chef/resource/inspec_input.rb +1 -3
- data/lib/chef/resource/inspec_waiver.rb +1 -1
- data/lib/chef/resource/inspec_waiver_file_entry.rb +1 -1
- data/lib/chef/resource/ips_package.rb +2 -2
- data/lib/chef/resource/kernel_module.rb +2 -2
- data/lib/chef/resource/link.rb +1 -1
- data/lib/chef/resource/locale.rb +2 -2
- data/lib/chef/resource/mount.rb +1 -1
- data/lib/chef/resource/notify_group.rb +1 -1
- data/lib/chef/resource/ohai.rb +1 -1
- data/lib/chef/resource/ohai_hint.rb +1 -1
- data/lib/chef/resource/openbsd_package.rb +2 -2
- data/lib/chef/resource/package.rb +1 -1
- data/lib/chef/resource/pacman_package.rb +1 -1
- data/lib/chef/resource/paludis_package.rb +1 -1
- data/lib/chef/resource/portage_package.rb +1 -1
- data/lib/chef/resource/reboot.rb +1 -1
- data/lib/chef/resource/registry_key.rb +18 -0
- data/lib/chef/resource/remote_directory.rb +1 -1
- data/lib/chef/resource/remote_file.rb +1 -1
- data/lib/chef/resource/rhsm_errata.rb +1 -1
- data/lib/chef/resource/rhsm_errata_level.rb +1 -1
- data/lib/chef/resource/rhsm_register.rb +1 -1
- data/lib/chef/resource/rhsm_repo.rb +4 -3
- data/lib/chef/resource/rhsm_subscription.rb +9 -8
- data/lib/chef/resource/route.rb +1 -1
- data/lib/chef/resource/rpm_package.rb +1 -1
- data/lib/chef/resource/scm/git.rb +1 -1
- data/lib/chef/resource/scm/subversion.rb +1 -1
- data/lib/chef/resource/selinux/common_helpers.rb +1 -1
- data/lib/chef/resource/selinux_boolean.rb +1 -1
- data/lib/chef/resource/selinux_fcontext.rb +3 -3
- data/lib/chef/resource/selinux_install.rb +1 -1
- data/lib/chef/resource/selinux_login.rb +1 -1
- data/lib/chef/resource/selinux_module.rb +5 -5
- data/lib/chef/resource/selinux_permissive.rb +2 -2
- data/lib/chef/resource/selinux_port.rb +2 -2
- data/lib/chef/resource/selinux_state.rb +2 -2
- data/lib/chef/resource/selinux_user.rb +1 -1
- data/lib/chef/resource/smartos_package.rb +2 -2
- data/lib/chef/resource/snap_package.rb +1 -1
- data/lib/chef/resource/solaris_package.rb +1 -1
- data/lib/chef/resource/ssh_known_hosts_entry.rb +1 -1
- data/lib/chef/resource/sudo.rb +5 -5
- data/lib/chef/resource/support/client.erb +3 -2
- data/lib/chef/resource/swap_file.rb +6 -6
- data/lib/chef/resource/sysctl.rb +5 -5
- data/lib/chef/resource/systemd_unit.rb +1 -1
- data/lib/chef/resource/template.rb +1 -1
- data/lib/chef/resource/timezone.rb +5 -5
- data/lib/chef/resource/user/aix_user.rb +2 -2
- data/lib/chef/resource/user/linux_user.rb +2 -2
- data/lib/chef/resource/user/pw_user.rb +2 -2
- data/lib/chef/resource/user/solaris_user.rb +2 -2
- data/lib/chef/resource/user_ulimit.rb +1 -1
- data/lib/chef/resource/yum_repository.rb +1 -1
- data/lib/chef/resource/zypper_package.rb +2 -2
- data/lib/chef/resource/zypper_repository.rb +2 -2
- data/lib/chef/resource.rb +1 -0
- data/lib/chef/resource_inspector.rb +25 -7
- data/lib/chef/resource_reporter.rb +1 -0
- data/lib/chef/run_lock.rb +0 -3
- data/lib/chef/scan_access_control.rb +6 -6
- data/lib/chef/util/backup.rb +1 -1
- data/lib/chef/util/diff.rb +1 -14
- data/lib/chef/util/file_edit.rb +4 -4
- data/lib/chef/util/powershell/ps_credential.rb +10 -0
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/registry.rb +5 -1
- data/lib/chef/win32/security.rb +9 -0
- data/lib/chef.rb +0 -2
- data/spec/functional/assets/yumrepo-empty/repodata/repomd.xml +6 -6
- data/spec/functional/resource/cookbook_file_spec.rb +1 -1
- data/spec/functional/resource/registry_spec.rb +276 -609
- data/spec/integration/client/open_ssl_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/support/chef_helpers.rb +2 -2
- data/spec/support/platform_helpers.rb +8 -0
- data/spec/support/shared/functional/file_resource.rb +3 -3
- data/spec/tiny_server.rb +5 -2
- data/spec/unit/mixin/homebrew_spec.rb +118 -0
- data/spec/unit/provider/apt_repository_spec.rb +14 -9
- data/spec/unit/provider/package/chocolatey_spec.rb +1 -1
- data/spec/unit/provider/package/homebrew_spec.rb +4 -1
- data/spec/unit/provider/registry_key_spec.rb +18 -17
- data/spec/unit/provider/route_spec.rb +4 -6
- data/spec/unit/provider/user/windows_spec.rb +1 -0
- data/spec/unit/resource/rhsm_repo_spec.rb +0 -1
- data/spec/unit/resource/rhsm_subscription_spec.rb +0 -2
- data/spec/unit/resource_inspector_spec.rb +36 -0
- data/spec/unit/util/powershell/ps_credential_spec.rb +6 -0
- metadata +36 -44
- data/lib/chef/file_content_management/deploy/target_io.rb +0 -29
- data/lib/chef/provider/.gitkeep +0 -0
- data/lib/chef/provider/package/snap_tm.rb +0 -79
- data/lib/chef/resource/.gitkeep +0 -0
- data/lib/chef/target_io/dir.rb +0 -12
- data/lib/chef/target_io/etc.rb +0 -16
- data/lib/chef/target_io/file.rb +0 -12
- data/lib/chef/target_io/fileutils.rb +0 -12
- data/lib/chef/target_io/http.rb +0 -22
- data/lib/chef/target_io/io.rb +0 -12
- data/lib/chef/target_io/shadow.rb +0 -44
- data/lib/chef/target_io/train/dir.rb +0 -69
- data/lib/chef/target_io/train/etc.rb +0 -112
- data/lib/chef/target_io/train/file.rb +0 -219
- data/lib/chef/target_io/train/fileutils.rb +0 -220
- data/lib/chef/target_io/train/http.rb +0 -117
- data/lib/chef/target_io/train/io.rb +0 -13
- data/lib/chef/target_io/train/shadow.rb +0 -52
- data/lib/chef/target_io/train_compat.rb +0 -7
- data/lib/chef/target_io.rb +0 -9
- data/spec/unit/mixin/homebrew_user_spec.rb +0 -119
- /data/spec/functional/assets/yumrepo-empty/repodata/{01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523-filelists.sqlite.bz2 → 01a3b-filelists.sqlite.bz2} +0 -0
- /data/spec/functional/assets/yumrepo-empty/repodata/{401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz → 401dc-filelists.xml.gz} +0 -0
- /data/spec/functional/assets/yumrepo-empty/repodata/{5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945-primary.sqlite.bz2 → 5dc1e-primary.sqlite.bz2} +0 -0
- /data/spec/functional/assets/yumrepo-empty/repodata/{6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz → 6bf96-other.xml.gz} +0 -0
- /data/spec/functional/assets/yumrepo-empty/repodata/{7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4-other.sqlite.bz2 → 7c365-other.sqlite.bz2} +0 -0
- /data/spec/functional/assets/yumrepo-empty/repodata/{dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz → dabe2-primary.xml.gz} +0 -0
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 18.
|
4
|
+
version: 18.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 18.
|
19
|
+
version: 18.7.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 18.
|
26
|
+
version: 18.7.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: chef-utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 18.
|
33
|
+
version: 18.7.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 18.
|
40
|
+
version: 18.7.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: train-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +45,9 @@ dependencies:
|
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.10'
|
48
|
+
- - "<="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 3.12.7
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,20 +55,23 @@ dependencies:
|
|
52
55
|
- - "~>"
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '3.10'
|
58
|
+
- - "<="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 3.12.7
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: train-winrm
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
|
-
- - "
|
65
|
+
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2.
|
67
|
+
version: 0.2.17
|
62
68
|
type: :runtime
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
|
-
- - "
|
72
|
+
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.2.
|
74
|
+
version: 0.2.17
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: train-rest
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,9 +133,9 @@ dependencies:
|
|
127
133
|
- - ">="
|
128
134
|
- !ruby/object:Gem::Version
|
129
135
|
version: 2.0.3
|
130
|
-
- - "
|
136
|
+
- - "<="
|
131
137
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
138
|
+
version: 3.1.1
|
133
139
|
type: :runtime
|
134
140
|
prerelease: false
|
135
141
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -137,9 +143,9 @@ dependencies:
|
|
137
143
|
- - ">="
|
138
144
|
- !ruby/object:Gem::Version
|
139
145
|
version: 2.0.3
|
140
|
-
- - "
|
146
|
+
- - "<="
|
141
147
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
148
|
+
version: 3.1.1
|
143
149
|
- !ruby/object:Gem::Dependency
|
144
150
|
name: mixlib-authentication
|
145
151
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,6 +247,9 @@ dependencies:
|
|
241
247
|
- - ">="
|
242
248
|
- !ruby/object:Gem::Version
|
243
249
|
version: 1.15.5
|
250
|
+
- - "<="
|
251
|
+
- !ruby/object:Gem::Version
|
252
|
+
version: 1.16.3
|
244
253
|
type: :runtime
|
245
254
|
prerelease: false
|
246
255
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -248,6 +257,9 @@ dependencies:
|
|
248
257
|
- - ">="
|
249
258
|
- !ruby/object:Gem::Version
|
250
259
|
version: 1.15.5
|
260
|
+
- - "<="
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: 1.16.3
|
251
263
|
- !ruby/object:Gem::Dependency
|
252
264
|
name: ffi-yajl
|
253
265
|
requirement: !ruby/object:Gem::Requirement
|
@@ -362,14 +374,14 @@ dependencies:
|
|
362
374
|
requirements:
|
363
375
|
- - ">="
|
364
376
|
- !ruby/object:Gem::Version
|
365
|
-
version:
|
377
|
+
version: 15.0.17
|
366
378
|
type: :runtime
|
367
379
|
prerelease: false
|
368
380
|
version_requirements: !ruby/object:Gem::Requirement
|
369
381
|
requirements:
|
370
382
|
- - ">="
|
371
383
|
- !ruby/object:Gem::Version
|
372
|
-
version:
|
384
|
+
version: 15.0.17
|
373
385
|
- !ruby/object:Gem::Dependency
|
374
386
|
name: chef-vault
|
375
387
|
requirement: !ruby/object:Gem::Requirement
|
@@ -774,7 +786,6 @@ files:
|
|
774
786
|
- lib/chef/file_content_management/deploy/cp.rb
|
775
787
|
- lib/chef/file_content_management/deploy/mv_unix.rb
|
776
788
|
- lib/chef/file_content_management/deploy/mv_windows.rb
|
777
|
-
- lib/chef/file_content_management/deploy/target_io.rb
|
778
789
|
- lib/chef/file_content_management/tempfile.rb
|
779
790
|
- lib/chef/formatters/base.rb
|
780
791
|
- lib/chef/formatters/doc.rb
|
@@ -837,7 +848,7 @@ files:
|
|
837
848
|
- lib/chef/mixin/file_class.rb
|
838
849
|
- lib/chef/mixin/from_file.rb
|
839
850
|
- lib/chef/mixin/get_source_from_package.rb
|
840
|
-
- lib/chef/mixin/
|
851
|
+
- lib/chef/mixin/homebrew.rb
|
841
852
|
- lib/chef/mixin/lazy_module_include.rb
|
842
853
|
- lib/chef/mixin/notifying_block.rb
|
843
854
|
- lib/chef/mixin/openssl_helper.rb
|
@@ -898,7 +909,6 @@ files:
|
|
898
909
|
- lib/chef/policy_builder/policyfile.rb
|
899
910
|
- lib/chef/property.rb
|
900
911
|
- lib/chef/provider.rb
|
901
|
-
- lib/chef/provider/.gitkeep
|
902
912
|
- lib/chef/provider/batch.rb
|
903
913
|
- lib/chef/provider/cookbook_file.rb
|
904
914
|
- lib/chef/provider/cookbook_file/content.rb
|
@@ -966,7 +976,6 @@ files:
|
|
966
976
|
- lib/chef/provider/package/rubygems.rb
|
967
977
|
- lib/chef/provider/package/smartos.rb
|
968
978
|
- lib/chef/provider/package/snap.rb
|
969
|
-
- lib/chef/provider/package/snap_tm.rb
|
970
979
|
- lib/chef/provider/package/solaris.rb
|
971
980
|
- lib/chef/provider/package/windows.rb
|
972
981
|
- lib/chef/provider/package/windows/exe.rb
|
@@ -1040,7 +1049,6 @@ files:
|
|
1040
1049
|
- lib/chef/request_id.rb
|
1041
1050
|
- lib/chef/reserved_names.rb
|
1042
1051
|
- lib/chef/resource.rb
|
1043
|
-
- lib/chef/resource/.gitkeep
|
1044
1052
|
- lib/chef/resource/_rest_resource.rb
|
1045
1053
|
- lib/chef/resource/action_class.rb
|
1046
1054
|
- lib/chef/resource/alternatives.rb
|
@@ -1284,22 +1292,6 @@ files:
|
|
1284
1292
|
- lib/chef/shell/ext.rb
|
1285
1293
|
- lib/chef/shell/model_wrapper.rb
|
1286
1294
|
- lib/chef/shell/shell_session.rb
|
1287
|
-
- lib/chef/target_io.rb
|
1288
|
-
- lib/chef/target_io/dir.rb
|
1289
|
-
- lib/chef/target_io/etc.rb
|
1290
|
-
- lib/chef/target_io/file.rb
|
1291
|
-
- lib/chef/target_io/fileutils.rb
|
1292
|
-
- lib/chef/target_io/http.rb
|
1293
|
-
- lib/chef/target_io/io.rb
|
1294
|
-
- lib/chef/target_io/shadow.rb
|
1295
|
-
- lib/chef/target_io/train/dir.rb
|
1296
|
-
- lib/chef/target_io/train/etc.rb
|
1297
|
-
- lib/chef/target_io/train/file.rb
|
1298
|
-
- lib/chef/target_io/train/fileutils.rb
|
1299
|
-
- lib/chef/target_io/train/http.rb
|
1300
|
-
- lib/chef/target_io/train/io.rb
|
1301
|
-
- lib/chef/target_io/train/shadow.rb
|
1302
|
-
- lib/chef/target_io/train_compat.rb
|
1303
1295
|
- lib/chef/train_transport.rb
|
1304
1296
|
- lib/chef/user.rb
|
1305
1297
|
- lib/chef/user_v1.rb
|
@@ -1753,12 +1745,12 @@ files:
|
|
1753
1745
|
- spec/functional/assets/mytest-1.0-1.noarch.rpm
|
1754
1746
|
- spec/functional/assets/mytest-2.0-1.noarch.rpm
|
1755
1747
|
- spec/functional/assets/testchefsubsys
|
1756
|
-
- spec/functional/assets/yumrepo-empty/repodata/
|
1757
|
-
- spec/functional/assets/yumrepo-empty/repodata/
|
1758
|
-
- spec/functional/assets/yumrepo-empty/repodata/
|
1759
|
-
- spec/functional/assets/yumrepo-empty/repodata/
|
1760
|
-
- spec/functional/assets/yumrepo-empty/repodata/
|
1761
|
-
- spec/functional/assets/yumrepo-empty/repodata/
|
1748
|
+
- spec/functional/assets/yumrepo-empty/repodata/01a3b-filelists.sqlite.bz2
|
1749
|
+
- spec/functional/assets/yumrepo-empty/repodata/401dc-filelists.xml.gz
|
1750
|
+
- spec/functional/assets/yumrepo-empty/repodata/5dc1e-primary.sqlite.bz2
|
1751
|
+
- spec/functional/assets/yumrepo-empty/repodata/6bf96-other.xml.gz
|
1752
|
+
- spec/functional/assets/yumrepo-empty/repodata/7c365-other.sqlite.bz2
|
1753
|
+
- spec/functional/assets/yumrepo-empty/repodata/dabe2-primary.xml.gz
|
1762
1754
|
- spec/functional/assets/yumrepo-empty/repodata/repomd.xml
|
1763
1755
|
- spec/functional/assets/yumrepo/chef_rpm-1.10-1.aarch64.rpm
|
1764
1756
|
- spec/functional/assets/yumrepo/chef_rpm-1.10-1.i686.rpm
|
@@ -2080,7 +2072,7 @@ files:
|
|
2080
2072
|
- spec/unit/mixin/default_paths_spec.rb
|
2081
2073
|
- spec/unit/mixin/deprecation_spec.rb
|
2082
2074
|
- spec/unit/mixin/enforce_ownership_and_permissions_spec.rb
|
2083
|
-
- spec/unit/mixin/
|
2075
|
+
- spec/unit/mixin/homebrew_spec.rb
|
2084
2076
|
- spec/unit/mixin/lazy_module_include.rb
|
2085
2077
|
- spec/unit/mixin/openssl_helper_spec.rb
|
2086
2078
|
- spec/unit/mixin/params_validate_spec.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module TargetIO
|
2
|
-
class Deploy
|
3
|
-
def create(file)
|
4
|
-
Chef::Log.trace("Touching #{file} to create it")
|
5
|
-
TargetIO::FileUtils.touch(file)
|
6
|
-
end
|
7
|
-
|
8
|
-
def deploy(src, dst)
|
9
|
-
Chef::Log.trace("Reading modes from remote file #{dst}")
|
10
|
-
stat = ::TargetIO::File.stat(dst)
|
11
|
-
mode = stat.mode & 07777
|
12
|
-
uid = stat.uid
|
13
|
-
gid = stat.gid
|
14
|
-
|
15
|
-
# TODO: Switch to TargetIO::File.open as soon as writing is implemented
|
16
|
-
Chef::Log.trace("Uploading local temporary file #{src} as remote file #{dst}")
|
17
|
-
connection = Chef.run_context&.transport_connection
|
18
|
-
connection.upload(src, dst)
|
19
|
-
|
20
|
-
Chef::Log.trace("Applying mode = #{mode.to_s(8)}, uid = #{uid}, gid = #{gid} to #{dst}")
|
21
|
-
::TargetIO::File.chown(uid, nil, dst)
|
22
|
-
::TargetIO::File.chown(nil, gid, dst)
|
23
|
-
::TargetIO::File.chmod(mode, dst)
|
24
|
-
|
25
|
-
# Local clean up
|
26
|
-
File.delete(src)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/lib/chef/provider/.gitkeep
DELETED
File without changes
|
@@ -1,79 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: T.Heinen (<thomas.heinen@gmail.com>)
|
3
|
-
# Copyright:: Copyright (c) Chef Software Inc.
|
4
|
-
# License:: Apache License, Version 2.0
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
#
|
18
|
-
|
19
|
-
require_relative "snap"
|
20
|
-
|
21
|
-
class Chef
|
22
|
-
class Provider
|
23
|
-
class Package
|
24
|
-
class SnapTM < Chef::Provider::Package::Snap
|
25
|
-
provides :snap_package, target_mode: true
|
26
|
-
|
27
|
-
def install_package(names, versions)
|
28
|
-
if new_resource.source
|
29
|
-
install_snap_from_source(names, new_resource.source)
|
30
|
-
else
|
31
|
-
Array(names).each do |snap|
|
32
|
-
snap_options = new_resource.options
|
33
|
-
|
34
|
-
snapctl([
|
35
|
-
"install",
|
36
|
-
"--channel=#{new_resource.channel}",
|
37
|
-
snap_options&.map { |opt| "--#{opt}" },
|
38
|
-
snap,
|
39
|
-
].flatten.compact)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def remove_package(names, versions)
|
45
|
-
Array(names).each do |snap|
|
46
|
-
snapctl([
|
47
|
-
"remove",
|
48
|
-
snap,
|
49
|
-
])
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def snapctl(*args)
|
54
|
-
# Deferred execution can result in exit code 10
|
55
|
-
shell_out!("snap", *args, returns: [0, 10])
|
56
|
-
end
|
57
|
-
|
58
|
-
def get_latest_package_version(name, channel)
|
59
|
-
cmd = shell_out("snap info #{name}")
|
60
|
-
latest = cmd.stdout.lines.detect { |l| l.start_with? " latest/#{new_resource.channel}:" }
|
61
|
-
return unless latest
|
62
|
-
|
63
|
-
latest.split.at(1)
|
64
|
-
end
|
65
|
-
|
66
|
-
def get_installed_package_by_name(name)
|
67
|
-
cmd = shell_out("snap info #{name}")
|
68
|
-
installed = cmd.stdout.lines.detect { |l| l.start_with? "installed:" }
|
69
|
-
return {} unless installed
|
70
|
-
|
71
|
-
{
|
72
|
-
"name" => name,
|
73
|
-
"version" => installed.split.at(1),
|
74
|
-
}
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
data/lib/chef/resource/.gitkeep
DELETED
File without changes
|
data/lib/chef/target_io/dir.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
module TargetIO
|
2
|
-
class Dir
|
3
|
-
class << self
|
4
|
-
def method_missing(m, *args, **kwargs, &block)
|
5
|
-
Chef::Log.debug format("Dir::%s(%s)", m.to_s, args.join(", "))
|
6
|
-
|
7
|
-
backend = ChefConfig::Config.target_mode? ? TrainCompat::Dir : ::Dir
|
8
|
-
backend.send(m, *args, **kwargs, &block)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/lib/chef/target_io/etc.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
module TargetIO
|
2
|
-
class Etc
|
3
|
-
class << self
|
4
|
-
def method_missing(m, *args, **kwargs, &block)
|
5
|
-
Chef::Log.debug format("Etc::%s(%s)", m.to_s, args.join(", "))
|
6
|
-
|
7
|
-
if ChefConfig::Config.target_mode? && !Chef.run_context.transport_connection.os.unix?
|
8
|
-
raise "Etc support only on Unix, this is " + Chef.run_context.transport_connection.platform.title
|
9
|
-
end
|
10
|
-
|
11
|
-
backend = ChefConfig::Config.target_mode? ? TrainCompat::Etc : ::Etc
|
12
|
-
backend.send(m, *args, **kwargs, &block)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/lib/chef/target_io/file.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
module TargetIO
|
2
|
-
class File
|
3
|
-
class << self
|
4
|
-
def method_missing(m, *args, **kwargs, &block)
|
5
|
-
Chef::Log.debug format("File::%s(%s)", m.to_s, args.join(", "))
|
6
|
-
|
7
|
-
backend = ChefConfig::Config.target_mode? ? TrainCompat::File : ::File
|
8
|
-
backend.send(m, *args, **kwargs, &block)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module TargetIO
|
2
|
-
class FileUtils
|
3
|
-
class << self
|
4
|
-
def method_missing(m, *args, **kwargs, &block)
|
5
|
-
Chef::Log.debug format("FileUtils::%s(%s)", m.to_s, args.join(", "))
|
6
|
-
|
7
|
-
backend = ChefConfig::Config.target_mode? ? TrainCompat::FileUtils : ::FileUtils
|
8
|
-
backend.send(m, *args, **kwargs, &block)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/lib/chef/target_io/http.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require "forwardable" unless defined?(Forwardable)
|
2
|
-
|
3
|
-
require_relative "../http/simple"
|
4
|
-
require_relative "train/http"
|
5
|
-
|
6
|
-
module TargetIO
|
7
|
-
class HTTP
|
8
|
-
extend Forwardable
|
9
|
-
def_delegators :@http_class, :get, :head, :patch, :post, :put, :delete
|
10
|
-
|
11
|
-
# Only for Chef::Provider::RemoteFile::HTTP
|
12
|
-
def_delegators :@http_class, :streaming_request, :streaming_request_with_progress, :last_response
|
13
|
-
|
14
|
-
def initialize(url, http_client_opts = {})
|
15
|
-
if ::ChefConfig::Config.target_mode?
|
16
|
-
@http_class = TargetIO::TrainCompat::HTTP.new(url, http_client_opts)
|
17
|
-
else
|
18
|
-
@http_class = Chef::HTTP::Simple.new(url, http_client_opts)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/lib/chef/target_io/io.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
module TargetIO
|
2
|
-
class IO
|
3
|
-
class << self
|
4
|
-
def method_missing(m, *args, **kwargs, &block)
|
5
|
-
Chef::Log.debug format("IO::%s(%s)", m.to_s, args.join(", "))
|
6
|
-
|
7
|
-
backend = ChefConfig::Config.target_mode? ? TrainCompat::IO : ::IO
|
8
|
-
backend.send(m, *args, **kwargs, &block)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module TargetIO
|
2
|
-
module Shadow
|
3
|
-
# sp_namp - pointer to null-terminated user name.
|
4
|
-
# sp_pwdp - pointer to null-terminated password.
|
5
|
-
# sp_lstchg - days since Jan 1, 1970 password was last
|
6
|
-
# changed.
|
7
|
-
# sp_min - days before which password may not be changed.
|
8
|
-
# sp_max - days after which password must be changed.
|
9
|
-
# sp_warn - days before password is to expire that user is
|
10
|
-
# warned of pending password expiration.
|
11
|
-
# sp_inact - days after password expires that account is
|
12
|
-
# considered inactive and disabled.
|
13
|
-
# sp_expire - days since Jan 1, 1970 when account will be
|
14
|
-
# disabled
|
15
|
-
# sp_loginclass - pointer to null-terminated user login class.
|
16
|
-
Entry = Struct.new(
|
17
|
-
:sp_namp,
|
18
|
-
:sp_pwdp,
|
19
|
-
:sp_lstchg,
|
20
|
-
:sp_min,
|
21
|
-
:sp_max,
|
22
|
-
:sp_warn,
|
23
|
-
:sp_inact,
|
24
|
-
:sp_expire,
|
25
|
-
:sp_loginclass
|
26
|
-
)
|
27
|
-
|
28
|
-
class Passwd
|
29
|
-
class << self
|
30
|
-
|
31
|
-
def method_missing(m, *args, **kwargs, &block)
|
32
|
-
Chef::Log.debug format("Shadow::Passwd::%s(%s)", m.to_s, args.join(", "))
|
33
|
-
|
34
|
-
if ChefConfig::Config.target_mode? && !Chef.run_context.transport_connection.os.unix?
|
35
|
-
raise "Shadow support only on Unix, this is " + Chef.run_context.transport_connection.platform.title
|
36
|
-
end
|
37
|
-
|
38
|
-
backend = ChefConfig::Config.target_mode? ? TrainCompat::Shadow::Passwd : ::Shadow::Passwd
|
39
|
-
backend.send(m, *args, **kwargs, &block)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require_relative "file"
|
2
|
-
require_relative "fileutils"
|
3
|
-
|
4
|
-
module TargetIO
|
5
|
-
module TrainCompat
|
6
|
-
class Dir
|
7
|
-
class << self
|
8
|
-
# TODO: chdir, mktmpdir, pwd, home (Used in Resources)
|
9
|
-
|
10
|
-
def [](*patterns, base: ".", sort: true)
|
11
|
-
Dir.glob(patterns, 0, base, sort)
|
12
|
-
end
|
13
|
-
|
14
|
-
def delete(dir_name)
|
15
|
-
::TargetIO::FileUtils.rm_rf(dir_name)
|
16
|
-
end
|
17
|
-
|
18
|
-
def directory?(dir_name)
|
19
|
-
::TargetIO::File.directory? dir_name
|
20
|
-
end
|
21
|
-
|
22
|
-
def entries(dirname)
|
23
|
-
cmd = "ls -1a #{dirname}"
|
24
|
-
output = __run_command(cmd).stdout
|
25
|
-
output.split("\n")
|
26
|
-
end
|
27
|
-
|
28
|
-
def glob(pattern, flags = 0, base: ".", sort: true)
|
29
|
-
raise "Dir.glob flags not supported except FNM_DOTMATCH" unless [0, ::File::FNM_DOTMATCH].include? flags
|
30
|
-
|
31
|
-
pattern = Array(pattern)
|
32
|
-
matchdot = flags || ::File::FNM_DOTMATCH ? "dotglob" : ""
|
33
|
-
|
34
|
-
# TODO: Check for bash remotely
|
35
|
-
cmd += <<-BASH4
|
36
|
-
shopt -s globstar #{matchdot}
|
37
|
-
cd #{base}
|
38
|
-
for f in #{pattern.join(" ")}; do
|
39
|
-
printf '%s\n' "$f";
|
40
|
-
done
|
41
|
-
BASH4
|
42
|
-
|
43
|
-
output = __run_command(cmd).stdout
|
44
|
-
files = output.split("\n")
|
45
|
-
files.sort! if sort
|
46
|
-
|
47
|
-
files
|
48
|
-
end
|
49
|
-
|
50
|
-
def mkdir(dir_name, mode = nil)
|
51
|
-
::TargetIO::FileUtils.mkdir(dir_name)
|
52
|
-
::TargetIO::FileUtils.chmod(dir_name, mode) if mode
|
53
|
-
end
|
54
|
-
|
55
|
-
def unlink(dir_name)
|
56
|
-
::TargetIO::FileUtils.rmdir(dir_name)
|
57
|
-
end
|
58
|
-
|
59
|
-
def __run_command(cmd)
|
60
|
-
__transport_connection.run_command(cmd)
|
61
|
-
end
|
62
|
-
|
63
|
-
def __transport_connection
|
64
|
-
Chef.run_context&.transport_connection
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,112 +0,0 @@
|
|
1
|
-
require_relative "file"
|
2
|
-
|
3
|
-
module TargetIO
|
4
|
-
module TrainCompat
|
5
|
-
class Etc
|
6
|
-
@@cache = {}
|
7
|
-
|
8
|
-
class << self
|
9
|
-
def getpwnam(name)
|
10
|
-
__getpw { |entry| entry["user"] == name }
|
11
|
-
end
|
12
|
-
|
13
|
-
def getpwuid(uid)
|
14
|
-
__getpw { |entry| entry["uid"] == uid.to_i }
|
15
|
-
end
|
16
|
-
|
17
|
-
def getgrnam(name)
|
18
|
-
__getgr { |entry| entry["name"] == name }
|
19
|
-
end
|
20
|
-
|
21
|
-
def getgrgid(gid)
|
22
|
-
__getgr { |entry| entry["gid"] == gid.to_i }
|
23
|
-
end
|
24
|
-
|
25
|
-
def __getpw(&block)
|
26
|
-
content = ::TargetIO::File.read("/etc/passwd")
|
27
|
-
entries = __parse_passwd(content)
|
28
|
-
data = entries.detect(&block)
|
29
|
-
raise ArgumentError unless data
|
30
|
-
|
31
|
-
::Etc::Passwd.new(
|
32
|
-
data["user"],
|
33
|
-
data["password"],
|
34
|
-
data["uid"].to_i,
|
35
|
-
data["gid"].to_i,
|
36
|
-
data["desc"],
|
37
|
-
data["home"],
|
38
|
-
data["shell"]
|
39
|
-
)
|
40
|
-
end
|
41
|
-
|
42
|
-
# Parse /etc/passwd files.
|
43
|
-
# Courtesy of InSpec
|
44
|
-
#
|
45
|
-
# @param [String] content the raw content of /etc/passwd
|
46
|
-
# @return [Array] Collection of passwd entries
|
47
|
-
def __parse_passwd(content)
|
48
|
-
content.to_s.split("\n").map do |line|
|
49
|
-
next if line[0] == "#"
|
50
|
-
|
51
|
-
__parse_passwd_line(line)
|
52
|
-
end.compact
|
53
|
-
end
|
54
|
-
|
55
|
-
# Parse a line of /etc/passwd
|
56
|
-
#
|
57
|
-
# @param [String] line a line of /etc/passwd
|
58
|
-
# @return [Hash] Map of entries in this line
|
59
|
-
def __parse_passwd_line(line)
|
60
|
-
x = line.split(":")
|
61
|
-
{
|
62
|
-
# rubocop:disable Layout/AlignHash
|
63
|
-
"user" => x.at(0),
|
64
|
-
"password" => x.at(1),
|
65
|
-
"uid" => x.at(2),
|
66
|
-
"gid" => x.at(3),
|
67
|
-
"desc" => x.at(4),
|
68
|
-
"home" => x.at(5),
|
69
|
-
"shell" => x.at(6),
|
70
|
-
}
|
71
|
-
end
|
72
|
-
|
73
|
-
def __getgr(&block)
|
74
|
-
content = ::TargetIO::File.read("/etc/group")
|
75
|
-
entries = __parse_group(content)
|
76
|
-
data = entries.detect(&block)
|
77
|
-
raise ArgumentError unless data
|
78
|
-
|
79
|
-
::Etc::Group.new(
|
80
|
-
data["name"],
|
81
|
-
data["password"],
|
82
|
-
data["gid"].to_i,
|
83
|
-
String(data["mem"]).split(",")
|
84
|
-
)
|
85
|
-
end
|
86
|
-
|
87
|
-
def __parse_group(content)
|
88
|
-
content.to_s.split("\n").map do |line|
|
89
|
-
next if line[0] == "#"
|
90
|
-
|
91
|
-
__parse_group_line(line)
|
92
|
-
end.compact
|
93
|
-
end
|
94
|
-
|
95
|
-
def __parse_group_line(line)
|
96
|
-
x = line.split(":")
|
97
|
-
{
|
98
|
-
# rubocop:disable Layout/AlignHash
|
99
|
-
"name" => x.at(0),
|
100
|
-
"password" => x.at(1),
|
101
|
-
"gid" => x.at(2),
|
102
|
-
"mem" => x.at(3),
|
103
|
-
}
|
104
|
-
end
|
105
|
-
|
106
|
-
def __transport_connection
|
107
|
-
Chef.run_context&.transport_connection
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|