chef 15.4.45-universal-mingw32 → 15.5.9-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -3
- data/Rakefile +5 -3
- data/chef.gemspec +2 -1
- data/ext/win32-eventlog/Rakefile +9 -1
- data/ext/win32-eventlog/{chef-log.man → chef-log.man.erb} +4 -4
- data/lib/chef/application.rb +2 -2
- data/lib/chef/application/client.rb +1 -1
- data/lib/chef/application/knife.rb +1 -0
- data/lib/chef/application/solo.rb +1 -1
- data/lib/chef/chef_class.rb +1 -6
- data/lib/chef/chef_fs.rb +1 -1
- data/lib/chef/chef_fs/file_pattern.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +7 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +4 -3
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +3 -3
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/nodes_dir.rb +3 -3
- data/lib/chef/chef_fs/knife.rb +1 -1
- data/lib/chef/chef_fs/path_utils.rb +2 -2
- data/lib/chef/client.rb +4 -5
- data/lib/chef/config.rb +3 -2
- data/lib/chef/cookbook/chefignore.rb +16 -11
- data/lib/chef/cookbook/cookbook_version_loader.rb +1 -1
- data/lib/chef/cookbook/syntax_check.rb +5 -3
- data/lib/chef/cookbook_loader.rb +3 -3
- data/lib/chef/cookbook_uploader.rb +1 -1
- data/lib/chef/data_collector.rb +2 -2
- data/lib/chef/data_collector/run_end_message.rb +1 -0
- data/lib/chef/deprecated.rb +4 -0
- data/lib/chef/dsl/core.rb +1 -1
- data/lib/chef/dsl/platform_introspection.rb +9 -18
- data/lib/chef/event_loggers/windows_eventlog.rb +1 -1
- data/lib/chef/file_content_management/deploy.rb +3 -3
- data/lib/chef/file_content_management/deploy/mv_windows.rb +2 -2
- data/lib/chef/file_content_management/tempfile.rb +1 -1
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +2 -2
- data/lib/chef/http.rb +1 -1
- data/lib/chef/http/socketless_chef_zero_client.rb +1 -1
- data/lib/chef/knife.rb +4 -3
- data/lib/chef/knife/config_get.rb +2 -1
- data/lib/chef/knife/configure.rb +1 -1
- data/lib/chef/knife/cookbook_metadata_from_file.rb +6 -0
- data/lib/chef/knife/core/generic_presenter.rb +1 -1
- data/lib/chef/knife/core/status_presenter.rb +1 -1
- data/lib/chef/knife/ssh.rb +6 -0
- data/lib/chef/local_mode.rb +1 -1
- data/lib/chef/mash.rb +21 -232
- data/lib/chef/mixin/file_class.rb +2 -2
- data/lib/chef/mixin/lazy_module_include.rb +1 -1
- data/lib/chef/mixin/path_sanity.rb +3 -39
- data/lib/chef/mixin/securable.rb +1 -1
- data/lib/chef/mixin/shell_out.rb +4 -5
- data/lib/chef/mixin/template.rb +1 -1
- data/lib/chef/mixin/user_context.rb +3 -3
- data/lib/chef/mixin/which.rb +10 -38
- data/lib/chef/mixin/windows_architecture_helper.rb +6 -6
- data/lib/chef/mixin/windows_env_helper.rb +5 -5
- data/lib/chef/node/attribute.rb +2 -2
- data/lib/chef/node_map.rb +17 -4
- data/lib/chef/platform/query_helpers.rb +4 -2
- data/lib/chef/platform/rebooter.rb +1 -1
- data/lib/chef/platform/service_helpers.rb +14 -85
- data/lib/chef/provider.rb +2 -0
- data/lib/chef/provider/file.rb +2 -2
- data/lib/chef/provider/ifconfig/redhat.rb +1 -1
- data/lib/chef/provider/link.rb +3 -3
- data/lib/chef/provider/mount/solaris.rb +1 -1
- data/lib/chef/provider/package/yum.rb +1 -1
- data/lib/chef/provider/registry_key.rb +1 -1
- data/lib/chef/provider/remote_directory.rb +3 -3
- data/lib/chef/provider/remote_file/fetcher.rb +2 -2
- data/lib/chef/provider/remote_file/local_file.rb +1 -1
- data/lib/chef/provider/script.rb +3 -3
- data/lib/chef/provider/service.rb +5 -2
- data/lib/chef/provider/service/arch.rb +1 -1
- data/lib/chef/provider/service/debian.rb +4 -4
- data/lib/chef/provider/service/init.rb +1 -1
- data/lib/chef/provider/service/insserv.rb +4 -4
- data/lib/chef/provider/service/invokercd.rb +4 -4
- data/lib/chef/provider/service/redhat.rb +4 -4
- data/lib/chef/provider/service/systemd.rb +19 -3
- data/lib/chef/provider/service/upstart.rb +3 -3
- data/lib/chef/provider/subversion.rb +1 -1
- data/lib/chef/provider/systemd_unit.rb +26 -2
- data/lib/chef/provider/windows_path.rb +3 -3
- data/lib/chef/provider/windows_task.rb +4 -4
- data/lib/chef/resource.rb +1 -0
- data/lib/chef/resource/bash.rb +2 -0
- data/lib/chef/resource/batch.rb +2 -0
- data/lib/chef/resource/breakpoint.rb +3 -1
- data/lib/chef/resource/build_essential.rb +3 -3
- data/lib/chef/resource/chef_sleep.rb +70 -0
- data/lib/chef/resource/cookbook_file.rb +2 -1
- data/lib/chef/resource/csh.rb +2 -0
- data/lib/chef/resource/directory.rb +2 -0
- data/lib/chef/resource/dmg_package.rb +1 -1
- data/lib/chef/resource/dnf_package.rb +1 -1
- data/lib/chef/resource/execute.rb +2 -0
- data/lib/chef/resource/file.rb +2 -1
- data/lib/chef/resource/git.rb +2 -0
- data/lib/chef/resource/group.rb +1 -1
- data/lib/chef/resource/homebrew_package.rb +1 -1
- data/lib/chef/resource/http_request.rb +2 -0
- data/lib/chef/resource/ifconfig.rb +3 -1
- data/lib/chef/resource/ksh.rb +2 -0
- data/lib/chef/resource/link.rb +4 -2
- data/lib/chef/resource/locale.rb +1 -1
- data/lib/chef/resource/log.rb +2 -0
- data/lib/chef/resource/ohai.rb +2 -0
- data/lib/chef/resource/perl.rb +2 -0
- data/lib/chef/resource/python.rb +2 -0
- data/lib/chef/resource/reboot.rb +2 -0
- data/lib/chef/resource/registry_key.rb +2 -0
- data/lib/chef/resource/remote_directory.rb +3 -2
- data/lib/chef/resource/remote_file.rb +1 -0
- data/lib/chef/resource/ruby.rb +2 -0
- data/lib/chef/resource/ruby_block.rb +2 -0
- data/lib/chef/resource/scm.rb +2 -0
- data/lib/chef/resource/script.rb +2 -0
- data/lib/chef/resource/service.rb +9 -1
- data/lib/chef/resource/solaris_package.rb +1 -1
- data/lib/chef/resource/subversion.rb +2 -0
- data/lib/chef/resource/sudo.rb +1 -1
- data/lib/chef/resource/systemd_unit.rb +1 -0
- data/lib/chef/resource/template.rb +2 -0
- data/lib/chef/resource/user.rb +2 -0
- data/lib/chef/resource/user/aix_user.rb +2 -0
- data/lib/chef/resource/user/linux_user.rb +2 -0
- data/lib/chef/resource/user/pw_user.rb +2 -0
- data/lib/chef/resource/user/solaris_user.rb +2 -0
- data/lib/chef/resource/user/windows_user.rb +2 -0
- data/lib/chef/resource/whyrun_safe_ruby_block.rb +1 -0
- data/lib/chef/resource/windows_ad_join.rb +1 -1
- data/lib/chef/resource/windows_env.rb +1 -1
- data/lib/chef/resource/windows_feature.rb +2 -2
- data/lib/chef/resource/windows_feature_powershell.rb +1 -1
- data/lib/chef/resource/windows_firewall_rule.rb +11 -6
- data/lib/chef/resource/windows_script.rb +3 -1
- data/lib/chef/resource/yum_package.rb +1 -1
- data/lib/chef/resource_reporter.rb +1 -1
- data/lib/chef/resources.rb +1 -0
- data/lib/chef/run_context.rb +1 -1
- data/lib/chef/run_lock.rb +5 -5
- data/lib/chef/search/query.rb +0 -3
- data/lib/chef/train_transport.rb +3 -1
- data/lib/chef/util/powershell/ps_credential.rb +2 -2
- data/lib/chef/util/selinux.rb +1 -1
- data/lib/chef/util/windows/logon_session.rb +2 -2
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/eventlog.rb +2 -2
- data/spec/data/cookbooks/starter/chefignore +8 -0
- data/spec/data/cookbooks/starter/files/sample.txt +1 -0
- data/spec/data/cookbooks/starter/metadata.rb +2 -0
- data/spec/data/cookbooks/starter/recipes/default.rb +4 -0
- data/spec/functional/event_loggers/windows_eventlog_spec.rb +1 -1
- data/spec/functional/mixin/user_context_spec.rb +2 -2
- data/spec/functional/rebooter_spec.rb +1 -1
- data/spec/functional/resource/cookbook_file_spec.rb +2 -2
- data/spec/functional/resource/template_spec.rb +1 -1
- data/spec/functional/version_spec.rb +1 -1
- data/spec/functional/win32/crypto_spec.rb +1 -1
- data/spec/functional/win32/security_spec.rb +1 -1
- data/spec/functional/win32/service_manager_spec.rb +1 -1
- data/spec/functional/win32/sid_spec.rb +2 -2
- data/spec/functional/win32/version_info_spec.rb +1 -1
- data/spec/functional/win32/versions_spec.rb +1 -1
- data/spec/integration/knife/config_get_profile_spec.rb +2 -2
- data/spec/integration/knife/config_get_spec.rb +9 -2
- data/spec/integration/knife/config_list_profiles_spec.rb +2 -2
- data/spec/integration/knife/config_use_profile_spec.rb +2 -2
- data/spec/integration/knife/list_spec.rb +2 -2
- data/spec/integration/solo/solo_spec.rb +1 -1
- data/spec/support/matchers/leak.rb +1 -1
- data/spec/support/mock/platform.rb +1 -1
- data/spec/support/platform_helpers.rb +2 -0
- data/spec/support/shared/integration/integration_helper.rb +1 -1
- data/spec/support/shared/integration/knife_support.rb +1 -1
- data/spec/support/shared/unit/provider/file.rb +4 -4
- data/spec/unit/application/client_spec.rb +2 -2
- data/spec/unit/application/knife_spec.rb +17 -0
- data/spec/unit/application_spec.rb +1 -1
- data/spec/unit/chef_fs/file_pattern_spec.rb +2 -2
- data/spec/unit/chef_fs/path_util_spec.rb +3 -3
- data/spec/unit/client_spec.rb +2 -2
- data/spec/unit/cookbook/chefignore_spec.rb +31 -11
- data/spec/unit/cookbook/cookbook_version_loader_spec.rb +1 -1
- data/spec/unit/cookbook/syntax_check_spec.rb +2 -2
- data/spec/unit/cookbook_loader_spec.rb +2 -2
- data/spec/unit/cookbook_uploader_spec.rb +6 -1
- data/spec/unit/data_bag_spec.rb +2 -2
- data/spec/unit/data_collector_spec.rb +7 -0
- data/spec/unit/dsl/platform_introspection_spec.rb +31 -1
- data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +1 -1
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +1 -1
- data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +7 -0
- data/spec/unit/knife/cookbook_show_spec.rb +1 -1
- data/spec/unit/knife/core/gem_glob_loader_spec.rb +1 -1
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +1 -1
- data/spec/unit/knife/core/subcommand_loader_spec.rb +1 -1
- data/spec/unit/knife/core/ui_spec.rb +2 -2
- data/spec/unit/knife/data_bag_from_file_spec.rb +2 -2
- data/spec/unit/knife/environment_from_file_spec.rb +2 -2
- data/spec/unit/knife/ssh_spec.rb +27 -17
- data/spec/unit/knife/status_spec.rb +1 -1
- data/spec/unit/knife/supermarket_install_spec.rb +1 -1
- data/spec/unit/mixin/path_sanity_spec.rb +3 -3
- data/spec/unit/mixin/shell_out_spec.rb +2 -3
- data/spec/unit/mixin/template_spec.rb +4 -4
- data/spec/unit/mixin/user_context_spec.rb +3 -3
- data/spec/unit/node_map_spec.rb +12 -12
- data/spec/unit/platform/query_helpers_spec.rb +9 -9
- data/spec/unit/provider/execute_spec.rb +1 -1
- data/spec/unit/provider/link_spec.rb +5 -5
- data/spec/unit/provider/package/openbsd_spec.rb +1 -1
- data/spec/unit/provider/package/smartos_spec.rb +1 -1
- data/spec/unit/provider/package/windows/exe_spec.rb +1 -1
- data/spec/unit/provider/package/windows_spec.rb +2 -2
- data/spec/unit/provider/remote_file/fetcher_spec.rb +2 -2
- data/spec/unit/provider/remote_file/local_file_spec.rb +1 -1
- data/spec/unit/provider/remote_file/network_file_spec.rb +1 -1
- data/spec/unit/provider/script_spec.rb +2 -2
- data/spec/unit/provider/service/systemd_service_spec.rb +26 -2
- data/spec/unit/provider/subversion_spec.rb +3 -3
- data/spec/unit/provider/systemd_unit_spec.rb +53 -4
- data/spec/unit/provider/user/dscl_spec.rb +1 -1
- data/spec/unit/provider_resolver_spec.rb +41 -61
- data/spec/unit/resource/chef_sleep_spec.rb +30 -0
- data/spec/unit/resource/cookbook_file_spec.rb +3 -3
- data/spec/unit/resource/remote_file_spec.rb +3 -3
- data/spec/unit/resource/windows_firewall_rule_spec.rb +69 -12
- data/spec/unit/role_spec.rb +2 -2
- data/spec/unit/shell_spec.rb +1 -1
- data/spec/unit/util/selinux_spec.rb +2 -2
- data/spec/unit/win32/error_spec.rb +1 -1
- data/spec/unit/win32/link_spec.rb +1 -1
- data/spec/unit/win32/security_spec.rb +1 -1
- data/spec/unit/windows_service_spec.rb +1 -1
- data/tasks/docs.rb +10 -2
- data/tasks/rspec.rb +8 -6
- metadata +33 -9
- data/lib/chef/mixin/train_helpers.rb +0 -60
- data/spec/unit/mash_spec.rb +0 -51
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Toomas Pelberg (<toomasp@gmx.net>)
|
3
3
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
4
|
-
# Copyright:: Copyright 2013-
|
4
|
+
# Copyright:: Copyright 2013-2018, Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -23,6 +23,8 @@ require_relative "../dist"
|
|
23
23
|
class Chef
|
24
24
|
class Resource
|
25
25
|
class Subversion < Chef::Resource::Scm
|
26
|
+
unified_mode true
|
27
|
+
|
26
28
|
description "Use the subversion resource to manage source control resources that exist in a Subversion repository."
|
27
29
|
|
28
30
|
allowed_actions :force_export
|
data/lib/chef/resource/sudo.rb
CHANGED
@@ -30,7 +30,7 @@ class Chef
|
|
30
30
|
description "Use the sudo resource to add or remove individual sudo entries using sudoers.d files."\
|
31
31
|
" Sudo version 1.7.2 or newer is required to use the sudo resource, as it relies on the"\
|
32
32
|
" '#includedir' directive introduced in version 1.7.2. This resource does not enforce"\
|
33
|
-
" installation of the required sudo version.
|
33
|
+
" installation of the required sudo version. Chef-supported releases of Ubuntu, SuSE, Debian,"\
|
34
34
|
" and RHEL (6+) all support this feature."
|
35
35
|
introduced "14.0"
|
36
36
|
|
@@ -43,6 +43,7 @@ class Chef
|
|
43
43
|
property :active, [TrueClass, FalseClass], skip_docs: true
|
44
44
|
property :masked, [TrueClass, FalseClass], skip_docs: true
|
45
45
|
property :static, [TrueClass, FalseClass], skip_docs: true
|
46
|
+
property :indirect, [TrueClass, FalseClass], skip_docs: true
|
46
47
|
|
47
48
|
# User-provided properties
|
48
49
|
property :user, String, desired_state: false,
|
@@ -34,6 +34,8 @@ class Chef
|
|
34
34
|
# chef-client. This resource includes actions and properties from the file resource. Template files managed by the
|
35
35
|
# template resource follow the same file specificity rules as the remote_file and file resources.
|
36
36
|
class Template < Chef::Resource::File
|
37
|
+
unified_mode true
|
38
|
+
|
37
39
|
resource_name :template
|
38
40
|
provides :template
|
39
41
|
|
data/lib/chef/resource/user.rb
CHANGED
@@ -21,6 +21,8 @@ require_relative "../resource"
|
|
21
21
|
class Chef
|
22
22
|
class Resource
|
23
23
|
class User < Chef::Resource
|
24
|
+
unified_mode true
|
25
|
+
|
24
26
|
resource_name :user_resource_abstract_base_class # this prevents magickal class name DSL wiring
|
25
27
|
|
26
28
|
description "Use the user resource to add users, update existing users, remove users, and to lock/unlock user passwords."
|
@@ -59,7 +59,7 @@ class Chef
|
|
59
59
|
|
60
60
|
property :workgroup_name, String,
|
61
61
|
description: "Specifies the name of a workgroup to which the computer is added to when it is removed from the domain. The default value is WORKGROUP. This property is only applicable to the :leave action.",
|
62
|
-
introduced: "15.
|
62
|
+
introduced: "15.4"
|
63
63
|
|
64
64
|
# define this again so we can default it to true. Otherwise failures print the password
|
65
65
|
property :sensitive, [TrueClass, FalseClass],
|
@@ -26,7 +26,7 @@ class Chef
|
|
26
26
|
provides :windows_env
|
27
27
|
provides :env # backwards compat with the pre-Chef 14 resource name
|
28
28
|
|
29
|
-
description "Use the
|
29
|
+
description "Use the windows_env resource to manage environment keys in Microsoft Windows. After an environment key is set, Microsoft Windows must be restarted before the environment key will be available to the Task Scheduler."
|
30
30
|
|
31
31
|
default_action :create
|
32
32
|
allowed_actions :create, :delete, :modify
|
@@ -24,7 +24,7 @@ class Chef
|
|
24
24
|
resource_name :windows_feature
|
25
25
|
provides(:windows_feature) { true }
|
26
26
|
|
27
|
-
description "Use the windows_feature resource to add, remove or entirely delete Windows features and roles. This resource calls the 'windows_feature_dism' or 'windows_feature_powershell' resources depending on the specified installation method and defaults to
|
27
|
+
description "Use the windows_feature resource to add, remove or entirely delete Windows features and roles. This resource calls the 'windows_feature_dism' or 'windows_feature_powershell' resources depending on the specified installation method, and defaults to DISM, which is available on both Workstation and Server editions of Windows."
|
28
28
|
introduced "14.0"
|
29
29
|
|
30
30
|
property :feature_name, [Array, String],
|
@@ -35,7 +35,7 @@ class Chef
|
|
35
35
|
description: "Specify a local repository for the feature install."
|
36
36
|
|
37
37
|
property :all, [TrueClass, FalseClass],
|
38
|
-
description: "Install all sub
|
38
|
+
description: "Install all sub-features.",
|
39
39
|
default: false
|
40
40
|
|
41
41
|
property :management_tools, [TrueClass, FalseClass],
|
@@ -27,7 +27,7 @@ class Chef
|
|
27
27
|
resource_name :windows_feature_powershell
|
28
28
|
provides(:windows_feature_powershell) { true }
|
29
29
|
|
30
|
-
description "Use the windows_feature_powershell resource to add, remove, or entirely delete Windows features and roles using PowerShell. This resource offers significant speed benefits over the windows_feature_dism resource, but requires
|
30
|
+
description "Use the windows_feature_powershell resource to add, remove, or entirely delete Windows features and roles using PowerShell. This resource offers significant speed benefits over the windows_feature_dism resource, but requires installation of the Remote Server Administration Tools on non-server releases of Windows."
|
31
31
|
introduced "14.0"
|
32
32
|
|
33
33
|
property :feature_name, [Array, String],
|
@@ -67,10 +67,15 @@ class Chef
|
|
67
67
|
description: "The action of the firewall rule.",
|
68
68
|
coerce: proc { |f| f.is_a?(String) ? f.downcase.to_sym : f }
|
69
69
|
|
70
|
-
property :profile, [Symbol, String],
|
71
|
-
default: :any,
|
70
|
+
property :profile, [Symbol, String, Array],
|
71
|
+
default: :any,
|
72
72
|
description: "The profile the firewall rule applies to.",
|
73
|
-
coerce: proc { |p| p.
|
73
|
+
coerce: proc { |p| Array(p).map(&:downcase).map(&:to_sym).sort },
|
74
|
+
callbacks: {
|
75
|
+
"contains values not in :public, :private :domain, :any or :notapplicable" => lambda { |p|
|
76
|
+
p.all? { |e| %i{public private domain any notapplicable}.include?(e) }
|
77
|
+
},
|
78
|
+
}
|
74
79
|
|
75
80
|
property :program, String,
|
76
81
|
description: "The program the firewall rule applies to."
|
@@ -152,13 +157,13 @@ class Chef
|
|
152
157
|
cmd << " -DisplayName '#{new_resource.rule_name}'" if cmdlet_type == "New"
|
153
158
|
cmd << " -Description '#{new_resource.description}'" if new_resource.description
|
154
159
|
cmd << " -LocalAddress '#{new_resource.local_address}'" if new_resource.local_address
|
155
|
-
cmd << " -LocalPort #{new_resource.local_port.join(",")}" if new_resource.local_port
|
160
|
+
cmd << " -LocalPort '#{new_resource.local_port.join("', '")}'" if new_resource.local_port
|
156
161
|
cmd << " -RemoteAddress '#{new_resource.remote_address}'" if new_resource.remote_address
|
157
|
-
cmd << " -RemotePort #{new_resource.remote_port.join(",")}" if new_resource.remote_port
|
162
|
+
cmd << " -RemotePort '#{new_resource.remote_port.join("', '")}'" if new_resource.remote_port
|
158
163
|
cmd << " -Direction '#{new_resource.direction}'" if new_resource.direction
|
159
164
|
cmd << " -Protocol '#{new_resource.protocol}'" if new_resource.protocol
|
160
165
|
cmd << " -Action '#{new_resource.firewall_action}'" if new_resource.firewall_action
|
161
|
-
cmd << " -Profile '#{new_resource.profile}'" if new_resource.profile
|
166
|
+
cmd << " -Profile '#{new_resource.profile.join("', '")}'" if new_resource.profile
|
162
167
|
cmd << " -Program '#{new_resource.program}'" if new_resource.program
|
163
168
|
cmd << " -Service '#{new_resource.service}'" if new_resource.service
|
164
169
|
cmd << " -InterfaceType '#{new_resource.interface_type}'" if new_resource.interface_type
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Adam Edwards (<adamed@chef.io>)
|
3
|
-
# Copyright:: Copyright 2013-
|
3
|
+
# Copyright:: Copyright 2013-2019, Chef Software Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -23,6 +23,8 @@ require_relative "../mixin/windows_architecture_helper"
|
|
23
23
|
class Chef
|
24
24
|
class Resource
|
25
25
|
class WindowsScript < Chef::Resource::Script
|
26
|
+
unified_mode true
|
27
|
+
|
26
28
|
# This is an abstract resource meant to be subclasses; thus no 'provides'
|
27
29
|
|
28
30
|
set_guard_inherited_attributes(:architecture)
|
@@ -23,7 +23,7 @@ class Chef
|
|
23
23
|
class Resource
|
24
24
|
class YumPackage < Chef::Resource::Package
|
25
25
|
resource_name :yum_package
|
26
|
-
provides :package, platform_family:
|
26
|
+
provides :package, platform_family: "fedora_derived"
|
27
27
|
|
28
28
|
description "Use the yum_package resource to install, upgrade, and remove packages with Yum"\
|
29
29
|
" for the Red Hat and CentOS platforms. The yum_package resource is able to resolve"\
|
@@ -183,7 +183,7 @@ class Chef
|
|
183
183
|
|
184
184
|
# get only the top level resources and strip out the subcollections
|
185
185
|
def updated_resources
|
186
|
-
@updated_resources ||= action_collection
|
186
|
+
@updated_resources ||= action_collection&.filtered_collection(max_nesting: 0, up_to_date: false, skipped: false, unprocessed: false) || {}
|
187
187
|
end
|
188
188
|
|
189
189
|
def total_res_count
|
data/lib/chef/resources.rb
CHANGED
@@ -28,6 +28,7 @@ require_relative "resource/build_essential"
|
|
28
28
|
require_relative "resource/cookbook_file"
|
29
29
|
require_relative "resource/chef_gem"
|
30
30
|
require_relative "resource/chef_handler"
|
31
|
+
require_relative "resource/chef_sleep"
|
31
32
|
require_relative "resource/chocolatey_config"
|
32
33
|
require_relative "resource/chocolatey_feature"
|
33
34
|
require_relative "resource/chocolatey_package"
|
data/lib/chef/run_context.rb
CHANGED
data/lib/chef/run_lock.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Daniel DeLeo (<dan@chef.io>)
|
3
|
-
# Copyright:: Copyright 2012-
|
3
|
+
# Copyright:: Copyright 2012-2019, Chef Software Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
require_relative "mixin/create_path"
|
19
19
|
require "fcntl"
|
20
|
-
if
|
20
|
+
if ChefUtils.windows?
|
21
21
|
require_relative "win32/mutex"
|
22
22
|
end
|
23
23
|
require_relative "config"
|
@@ -97,7 +97,7 @@ class Chef
|
|
97
97
|
#
|
98
98
|
def wait
|
99
99
|
Chef::Log.warn("#{Chef::Dist::PRODUCT} #{runpid} is running, will wait for it to finish and then run.")
|
100
|
-
if
|
100
|
+
if ChefUtils.windows?
|
101
101
|
mutex.wait
|
102
102
|
else
|
103
103
|
runlock.flock(File::LOCK_EX)
|
@@ -116,7 +116,7 @@ class Chef
|
|
116
116
|
# Release the system-wide lock.
|
117
117
|
def release
|
118
118
|
if runlock
|
119
|
-
if
|
119
|
+
if ChefUtils.windows?
|
120
120
|
mutex.release
|
121
121
|
else
|
122
122
|
runlock.flock(File::LOCK_UN)
|
@@ -138,7 +138,7 @@ class Chef
|
|
138
138
|
|
139
139
|
# @api private solely for race condition tests
|
140
140
|
def acquire_lock
|
141
|
-
if
|
141
|
+
if ChefUtils.windows?
|
142
142
|
acquire_win32_mutex
|
143
143
|
else
|
144
144
|
# If we support FD_CLOEXEC, then use it.
|
data/lib/chef/search/query.rb
CHANGED
@@ -126,9 +126,6 @@ class Chef
|
|
126
126
|
return args.first if args.first.is_a?(Hash)
|
127
127
|
|
128
128
|
args_h = {}
|
129
|
-
# If we have 4 arguments, the first is the now-removed sort option, so
|
130
|
-
# just ignore it.
|
131
|
-
args.pop(0) if args.length == 4
|
132
129
|
args_h[:start] = args[0] if args[0]
|
133
130
|
args_h[:rows] = args[1]
|
134
131
|
args_h[:filter_result] = args[2]
|
data/lib/chef/train_transport.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Author:: Bryan McLellan <btm@loftninjas.org>
|
2
|
-
# Copyright:: Copyright 2018, Chef Software
|
2
|
+
# Copyright:: Copyright 2018-2019, Chef Software Inc.
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -92,6 +92,8 @@ class Chef
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def self.build_transport(logger = Chef::Log.with_child(subsystem: "transport"))
|
95
|
+
return nil unless Chef::Config.target_mode?
|
96
|
+
|
95
97
|
# TODO: Consider supporting parsing the protocol from a URI passed to `--target`
|
96
98
|
#
|
97
99
|
train_config = {}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Jay Mundrawala (<jdm@chef.io>)
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright 2015-
|
4
|
+
# Copyright:: Copyright 2015-2019, Chef Software Inc.
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require_relative "../../win32/crypto" if
|
19
|
+
require_relative "../../win32/crypto" if ChefUtils.windows?
|
20
20
|
|
21
21
|
class Chef::Util::Powershell
|
22
22
|
class PSCredential
|
data/lib/chef/util/selinux.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Author:: Kevin Keane
|
4
4
|
# Author:: Lamont Granquist (<lamont@chef.io>)
|
5
5
|
#
|
6
|
-
# Copyright:: Copyright 2011-
|
6
|
+
# Copyright:: Copyright 2011-2019, Chef Software Inc.
|
7
7
|
# Copyright:: Copyright 2013-2016, North County Tech Center, LLC
|
8
8
|
#
|
9
9
|
# License:: Apache License, Version 2.0
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Adam Edwards (<adamed@chef.io>)
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright (c) 2015 Chef Software
|
4
|
+
# Copyright:: Copyright (c) 2015-2019, Chef Software Inc.
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require_relative "../../win32/api/security" if
|
19
|
+
require_relative "../../win32/api/security" if ChefUtils.windows?
|
20
20
|
require_relative "../../mixin/wide_string"
|
21
21
|
|
22
22
|
class Chef
|
data/lib/chef/version.rb
CHANGED
data/lib/chef/win32/eventlog.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Jay Mundrawala (<jdm@chef.io>)
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright 2015-
|
4
|
+
# Copyright:: Copyright 2015-2019, Chef Software Inc.
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
if
|
19
|
+
if ChefUtils.windows?
|
20
20
|
unless defined? Chef::Win32EventLogLoaded
|
21
21
|
if defined? Windows::Constants
|
22
22
|
%i{INFINITE WAIT_FAILED FORMAT_MESSAGE_IGNORE_INSERTS ERROR_INSUFFICIENT_BUFFER}.each do |c|
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a Chef cookbook file. It is used to copy content verbatim on to a server.
|
@@ -17,8 +17,8 @@
|
|
17
17
|
|
18
18
|
require "spec_helper"
|
19
19
|
|
20
|
-
require "chef/win32/api" if
|
21
|
-
require "chef/win32/api/error" if
|
20
|
+
require "chef/win32/api" if ChefUtils.windows?
|
21
|
+
require "chef/win32/api/error" if ChefUtils.windows?
|
22
22
|
require "chef/mixin/user_context"
|
23
23
|
|
24
24
|
describe Chef::Mixin::UserContext, windows_only: true do
|
@@ -72,7 +72,7 @@ describe Chef::Platform::Rebooter do
|
|
72
72
|
|
73
73
|
shared_context "test a reboot method" do
|
74
74
|
def test_rebooter_method(method_sym, is_windows, is_solaris, expected_reboot_str)
|
75
|
-
allow(
|
75
|
+
allow(ChefUtils).to receive(:windows?).and_return(is_windows)
|
76
76
|
node.automatic["os"] = node.automatic["platform"] = node.automatic["platform_family"] = "solaris2" if is_solaris
|
77
77
|
expect(rebooter).to receive(:shell_out!).once.with(expected_reboot_str)
|
78
78
|
expect(rebooter).to receive(:raise).with(Chef::Exceptions::Reboot)
|