chef 12.4.0.rc.0-universal-mingw32 → 12.4.0.rc.2-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +12 -1
- data/lib/chef/api_client.rb +130 -26
- data/lib/chef/application.rb +0 -1
- data/lib/chef/application/client.rb +8 -19
- data/lib/chef/audit/audit_reporter.rb +12 -7
- data/lib/chef/audit/logger.rb +36 -0
- data/lib/chef/audit/runner.rb +4 -2
- data/lib/chef/chef_class.rb +62 -11
- data/lib/chef/client.rb +587 -207
- data/lib/chef/config.rb +0 -1
- data/lib/chef/dsl/recipe.rb +45 -56
- data/lib/chef/dsl/resources.rb +3 -2
- data/lib/chef/event_dispatch/base.rb +7 -2
- data/lib/chef/exceptions.rb +4 -1
- data/lib/chef/file_content_management/deploy/mv_windows.rb +16 -6
- data/lib/chef/formatters/doc.rb +15 -7
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +10 -7
- data/lib/chef/guard_interpreter/default_guard_interpreter.rb +2 -0
- data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +4 -1
- data/lib/chef/http/authenticator.rb +7 -2
- data/lib/chef/knife.rb +16 -4
- data/lib/chef/knife/client_create.rb +55 -31
- data/lib/chef/knife/core/generic_presenter.rb +1 -1
- data/lib/chef/knife/core/subcommand_loader.rb +1 -1
- data/lib/chef/knife/osc_user_create.rb +97 -0
- data/lib/chef/knife/osc_user_delete.rb +51 -0
- data/lib/chef/knife/osc_user_edit.rb +58 -0
- data/lib/chef/knife/osc_user_list.rb +47 -0
- data/lib/chef/knife/osc_user_reregister.rb +64 -0
- data/lib/chef/knife/osc_user_show.rb +54 -0
- data/lib/chef/knife/user_create.rb +95 -36
- data/lib/chef/knife/user_delete.rb +52 -2
- data/lib/chef/knife/user_edit.rb +37 -7
- data/lib/chef/knife/user_list.rb +3 -0
- data/lib/chef/knife/user_reregister.rb +39 -8
- data/lib/chef/knife/user_show.rb +30 -1
- data/lib/chef/mixin/api_version_request_handling.rb +66 -0
- data/lib/chef/mixin/convert_to_class_name.rb +10 -4
- data/lib/chef/mixin/deprecation.rb +24 -0
- data/lib/chef/mixin/powershell_out.rb +98 -0
- data/lib/chef/mixin/provides.rb +5 -18
- data/lib/chef/mixin/uris.rb +11 -0
- data/lib/chef/mixin/windows_architecture_helper.rb +5 -2
- data/lib/chef/mixin/windows_env_helper.rb +11 -2
- data/lib/chef/node_map.rb +130 -75
- data/lib/chef/osc_user.rb +194 -0
- data/lib/chef/platform/provider_mapping.rb +2 -269
- data/lib/chef/platform/provider_priority_map.rb +6 -69
- data/lib/chef/platform/query_helpers.rb +5 -0
- data/lib/chef/platform/resource_priority_map.rb +12 -15
- data/lib/chef/policy_builder/policyfile.rb +1 -0
- data/lib/chef/provider.rb +19 -0
- data/lib/chef/provider/directory.rb +3 -0
- data/lib/chef/provider/dsc_resource.rb +8 -1
- data/lib/chef/provider/file.rb +1 -0
- data/lib/chef/provider/group/aix.rb +1 -0
- data/lib/chef/provider/group/dscl.rb +1 -1
- data/lib/chef/provider/group/gpasswd.rb +1 -0
- data/lib/chef/provider/group/groupmod.rb +1 -1
- data/lib/chef/provider/group/pw.rb +1 -0
- data/lib/chef/provider/group/suse.rb +2 -0
- data/lib/chef/provider/group/usermod.rb +2 -1
- data/lib/chef/provider/group/windows.rb +1 -1
- data/lib/chef/provider/ifconfig.rb +2 -0
- data/lib/chef/provider/ifconfig/aix.rb +1 -0
- data/lib/chef/provider/ifconfig/debian.rb +2 -0
- data/lib/chef/provider/ifconfig/redhat.rb +1 -0
- data/lib/chef/provider/lwrp_base.rb +4 -0
- data/lib/chef/provider/mount.rb +0 -1
- data/lib/chef/provider/mount/aix.rb +1 -0
- data/lib/chef/provider/mount/mount.rb +2 -0
- data/lib/chef/provider/mount/solaris.rb +2 -0
- data/lib/chef/provider/package.rb +55 -0
- data/lib/chef/provider/package/aix.rb +7 -7
- data/lib/chef/provider/package/apt.rb +3 -3
- data/lib/chef/provider/package/dpkg.rb +4 -4
- data/lib/chef/provider/package/easy_install.rb +5 -5
- data/lib/chef/provider/package/freebsd/base.rb +2 -2
- data/lib/chef/provider/package/freebsd/pkg.rb +6 -6
- data/lib/chef/provider/package/freebsd/pkgng.rb +5 -5
- data/lib/chef/provider/package/freebsd/port.rb +4 -4
- data/lib/chef/provider/package/homebrew.rb +2 -2
- data/lib/chef/provider/package/ips.rb +4 -4
- data/lib/chef/provider/package/macports.rb +5 -6
- data/lib/chef/provider/package/openbsd.rb +4 -5
- data/lib/chef/provider/package/pacman.rb +4 -4
- data/lib/chef/provider/package/portage.rb +2 -0
- data/lib/chef/provider/package/rpm.rb +7 -8
- data/lib/chef/provider/package/rubygems.rb +5 -12
- data/lib/chef/provider/package/smartos.rb +4 -4
- data/lib/chef/provider/package/solaris.rb +7 -7
- data/lib/chef/provider/package/windows/msi.rb +1 -1
- data/lib/chef/provider/package/yum.rb +4 -6
- data/lib/chef/provider/package/zypper.rb +16 -14
- data/lib/chef/provider/powershell_script.rb +129 -47
- data/lib/chef/provider/remote_file/content.rb +4 -1
- data/lib/chef/provider/remote_file/local_file.rb +10 -4
- data/lib/chef/provider/service.rb +44 -0
- data/lib/chef/provider/service/freebsd.rb +1 -1
- data/lib/chef/provider/service/init.rb +1 -0
- data/lib/chef/provider/service/macosx.rb +1 -1
- data/lib/chef/provider/service/windows.rb +0 -1
- data/lib/chef/provider/user.rb +1 -1
- data/lib/chef/provider/user/aix.rb +3 -2
- data/lib/chef/provider/user/pw.rb +1 -0
- data/lib/chef/provider/user/solaris.rb +2 -0
- data/lib/chef/provider/user/useradd.rb +1 -0
- data/lib/chef/provider_resolver.rb +87 -134
- data/lib/chef/resource.rb +274 -68
- data/lib/chef/resource/apt_package.rb +0 -2
- data/lib/chef/resource/bash.rb +0 -2
- data/lib/chef/resource/batch.rb +1 -1
- data/lib/chef/resource/bff_package.rb +0 -7
- data/lib/chef/resource/breakpoint.rb +3 -6
- data/lib/chef/resource/chef_gem.rb +0 -3
- data/lib/chef/resource/cookbook_file.rb +1 -3
- data/lib/chef/resource/cron.rb +2 -4
- data/lib/chef/resource/csh.rb +0 -2
- data/lib/chef/resource/deploy.rb +9 -6
- data/lib/chef/resource/deploy_revision.rb +0 -14
- data/lib/chef/resource/directory.rb +2 -4
- data/lib/chef/resource/dpkg_package.rb +0 -5
- data/lib/chef/resource/dsc_resource.rb +2 -3
- data/lib/chef/resource/dsc_script.rb +2 -3
- data/lib/chef/resource/easy_install_package.rb +0 -7
- data/lib/chef/resource/env.rb +3 -3
- data/lib/chef/resource/erl_call.rb +2 -5
- data/lib/chef/resource/execute.rb +2 -4
- data/lib/chef/resource/file.rb +2 -4
- data/lib/chef/resource/freebsd_package.rb +0 -5
- data/lib/chef/resource/gem_package.rb +0 -3
- data/lib/chef/resource/git.rb +0 -3
- data/lib/chef/resource/group.rb +2 -4
- data/lib/chef/resource/homebrew_package.rb +0 -2
- data/lib/chef/resource/http_request.rb +3 -4
- data/lib/chef/resource/ifconfig.rb +3 -4
- data/lib/chef/resource/ips_package.rb +2 -2
- data/lib/chef/resource/link.rb +3 -5
- data/lib/chef/resource/log.rb +2 -4
- data/lib/chef/resource/lwrp_base.rb +10 -61
- data/lib/chef/resource/macosx_service.rb +1 -2
- data/lib/chef/resource/macports_package.rb +0 -7
- data/lib/chef/resource/mdadm.rb +2 -5
- data/lib/chef/resource/mount.rb +2 -4
- data/lib/chef/resource/ohai.rb +2 -4
- data/lib/chef/resource/openbsd_package.rb +0 -6
- data/lib/chef/resource/package.rb +9 -6
- data/lib/chef/resource/pacman_package.rb +0 -7
- data/lib/chef/resource/paludis_package.rb +2 -3
- data/lib/chef/resource/perl.rb +0 -3
- data/lib/chef/resource/portage_package.rb +0 -3
- data/lib/chef/resource/powershell_script.rb +1 -2
- data/lib/chef/resource/python.rb +0 -3
- data/lib/chef/resource/reboot.rb +1 -3
- data/lib/chef/resource/registry_key.rb +3 -5
- data/lib/chef/resource/remote_directory.rb +3 -5
- data/lib/chef/resource/remote_file.rb +4 -5
- data/lib/chef/resource/route.rb +3 -5
- data/lib/chef/resource/rpm_package.rb +0 -2
- data/lib/chef/resource/ruby.rb +0 -4
- data/lib/chef/resource/ruby_block.rb +2 -4
- data/lib/chef/resource/scm.rb +3 -5
- data/lib/chef/resource/script.rb +0 -3
- data/lib/chef/resource/service.rb +3 -5
- data/lib/chef/resource/smartos_package.rb +0 -9
- data/lib/chef/resource/solaris_package.rb +0 -10
- data/lib/chef/resource/subversion.rb +1 -3
- data/lib/chef/resource/template.rb +0 -4
- data/lib/chef/resource/timestamped_deploy.rb +0 -4
- data/lib/chef/resource/user.rb +2 -5
- data/lib/chef/resource/whyrun_safe_ruby_block.rb +0 -7
- data/lib/chef/resource/windows_package.rb +3 -3
- data/lib/chef/resource/windows_script.rb +2 -2
- data/lib/chef/resource/windows_service.rb +3 -3
- data/lib/chef/resource/yum_package.rb +0 -3
- data/lib/chef/resource/zypper_package.rb +27 -0
- data/lib/chef/resource_builder.rb +7 -0
- data/lib/chef/resource_reporter.rb +1 -1
- data/lib/chef/resource_resolver.rb +108 -62
- data/lib/chef/resources.rb +1 -0
- data/lib/chef/rest.rb +1 -0
- data/lib/chef/server_api.rb +2 -0
- data/lib/chef/user.rb +193 -42
- data/lib/chef/util/backup.rb +9 -1
- data/lib/chef/util/path_helper.rb +0 -1
- data/lib/chef/version.rb +1 -1
- data/spec/functional/audit/runner_spec.rb +22 -42
- data/spec/functional/mixin/powershell_out_spec.rb +43 -0
- data/spec/functional/resource/execute_spec.rb +9 -2
- data/spec/functional/resource/file_spec.rb +25 -0
- data/spec/functional/resource/group_spec.rb +5 -0
- data/spec/functional/resource/link_spec.rb +5 -11
- data/spec/functional/resource/powershell_spec.rb +40 -5
- data/spec/functional/resource/user/useradd_spec.rb +10 -18
- data/spec/integration/recipes/lwrp_spec.rb +57 -0
- data/spec/integration/recipes/provider_choice.rb +2 -7
- data/spec/integration/recipes/recipe_dsl_spec.rb +517 -19
- data/spec/spec_helper.rb +1 -1
- data/spec/support/lib/chef/provider/openldap_includer.rb +29 -0
- data/spec/support/lib/chef/resource/cat.rb +0 -2
- data/spec/support/lib/chef/resource/one_two_three_four.rb +0 -6
- data/spec/support/lib/chef/resource/openldap_includer.rb +27 -0
- data/spec/support/lib/chef/resource/with_state.rb +0 -9
- data/spec/support/lib/chef/resource/zen_follower.rb +0 -6
- data/spec/support/lib/chef/resource/zen_master.rb +1 -6
- data/spec/support/shared/context/client.rb +277 -0
- data/spec/support/shared/examples/client.rb +53 -0
- data/spec/support/shared/functional/file_resource.rb +0 -4
- data/spec/support/shared/functional/securable_resource.rb +0 -24
- data/spec/support/shared/functional/securable_resource_with_reporting.rb +4 -4
- data/spec/support/shared/functional/windows_script.rb +1 -1
- data/spec/support/shared/unit/api_versioning.rb +77 -0
- data/spec/support/shared/unit/knife_shared.rb +40 -0
- data/spec/support/shared/unit/user_and_client_shared.rb +115 -0
- data/spec/unit/api_client_spec.rb +189 -14
- data/spec/unit/application/client_spec.rb +0 -5
- data/spec/unit/audit/audit_reporter_spec.rb +58 -14
- data/spec/unit/audit/logger_spec.rb +42 -0
- data/spec/unit/audit/runner_spec.rb +2 -2
- data/spec/unit/chef_fs/file_pattern_spec.rb +3 -15
- data/spec/unit/client_spec.rb +58 -374
- data/spec/unit/cookbook_spec.rb +0 -9
- data/spec/unit/cookbook_version_spec.rb +0 -20
- data/spec/unit/deprecation_spec.rb +55 -0
- data/spec/unit/dsl/resources_spec.rb +85 -0
- data/spec/unit/exceptions_spec.rb +2 -2
- data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +60 -0
- data/spec/unit/formatters/doc_spec.rb +46 -0
- data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +12 -10
- data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +8 -0
- data/spec/unit/http/authenticator_spec.rb +11 -2
- data/spec/unit/knife/client_create_spec.rb +122 -51
- data/spec/unit/knife/core/subcommand_loader_spec.rb +19 -3
- data/spec/unit/knife/core/ui_spec.rb +14 -0
- data/spec/unit/knife/osc_user_create_spec.rb +93 -0
- data/spec/unit/knife/osc_user_delete_spec.rb +44 -0
- data/spec/unit/knife/osc_user_edit_spec.rb +52 -0
- data/spec/unit/knife/osc_user_list_spec.rb +37 -0
- data/spec/unit/knife/osc_user_reregister_spec.rb +58 -0
- data/spec/unit/knife/osc_user_show_spec.rb +46 -0
- data/spec/unit/knife/user_create_spec.rb +177 -51
- data/spec/unit/knife/user_delete_spec.rb +34 -8
- data/spec/unit/knife/user_edit_spec.rb +31 -12
- data/spec/unit/knife/user_list_spec.rb +7 -3
- data/spec/unit/knife/user_reregister_spec.rb +38 -17
- data/spec/unit/knife/user_show_spec.rb +35 -11
- data/spec/unit/knife_spec.rb +10 -4
- data/spec/unit/lwrp_spec.rb +228 -54
- data/spec/unit/mixin/api_version_request_handling_spec.rb +127 -0
- data/spec/unit/mixin/command_spec.rb +1 -2
- data/spec/unit/mixin/powershell_out_spec.rb +70 -0
- data/spec/unit/mixin/uris_spec.rb +23 -11
- data/spec/unit/node_map_spec.rb +4 -1
- data/spec/unit/osc_user_spec.rb +276 -0
- data/spec/unit/platform_spec.rb +0 -60
- data/spec/unit/provider/deploy_spec.rb +1 -1
- data/spec/unit/provider/directory_spec.rb +199 -135
- data/spec/unit/provider/ifconfig/debian_spec.rb +0 -10
- data/spec/unit/provider/package/aix_spec.rb +16 -16
- data/spec/unit/provider/package/dpkg_spec.rb +2 -2
- data/spec/unit/provider/package/freebsd/pkg_spec.rb +13 -13
- data/spec/unit/provider/package/freebsd/pkgng_spec.rb +9 -9
- data/spec/unit/provider/package/freebsd/port_spec.rb +7 -7
- data/spec/unit/provider/package/ips_spec.rb +22 -22
- data/spec/unit/provider/package/macports_spec.rb +10 -10
- data/spec/unit/provider/package/openbsd_spec.rb +4 -26
- data/spec/unit/provider/package/pacman_spec.rb +5 -5
- data/spec/unit/provider/package/rpm_spec.rb +14 -14
- data/spec/unit/provider/package/rubygems_spec.rb +10 -44
- data/spec/unit/provider/package/smartos_spec.rb +4 -4
- data/spec/unit/provider/package/solaris_spec.rb +11 -11
- data/spec/unit/provider/package/zypper_spec.rb +125 -90
- data/spec/unit/provider/package_spec.rb +34 -0
- data/spec/unit/provider/powershell_spec.rb +53 -11
- data/spec/unit/provider/remote_directory_spec.rb +2 -2
- data/spec/unit/provider/remote_file/local_file_spec.rb +25 -6
- data/spec/unit/provider/service/freebsd_service_spec.rb +0 -12
- data/spec/unit/provider/user_spec.rb +3 -3
- data/spec/unit/provider_resolver_spec.rb +463 -327
- data/spec/unit/recipe_spec.rb +42 -15
- data/spec/unit/resource/breakpoint_spec.rb +1 -1
- data/spec/unit/resource/erl_call_spec.rb +1 -1
- data/spec/unit/resource/file_spec.rb +1 -1
- data/spec/unit/resource/ifconfig_spec.rb +10 -6
- data/spec/unit/resource/remote_file_spec.rb +5 -0
- data/spec/unit/resource/route_spec.rb +1 -1
- data/spec/unit/resource/ruby_block_spec.rb +2 -2
- data/spec/unit/resource/template_spec.rb +1 -1
- data/spec/unit/resource/timestamped_deploy_spec.rb +1 -2
- data/spec/unit/resource/windows_service_spec.rb +1 -1
- data/spec/unit/resource_spec.rb +99 -13
- data/spec/unit/rest_spec.rb +5 -5
- data/spec/unit/run_context_spec.rb +41 -0
- data/spec/unit/runner_spec.rb +2 -2
- data/spec/unit/user_spec.rb +406 -93
- data/tasks/maintainers.rb +69 -0
- metadata +37 -4
@@ -20,13 +20,8 @@ require 'chef/log'
|
|
20
20
|
require 'chef/exceptions'
|
21
21
|
require 'chef/mixin/params_validate'
|
22
22
|
require 'chef/version_constraint/platform'
|
23
|
-
|
24
|
-
# This file depends on nearly every provider in chef, but requiring them
|
25
|
-
# directly causes circular requires resulting in uninitialized constant errors.
|
26
|
-
# Therefore, we do the includes inline rather than up top.
|
27
23
|
require 'chef/provider'
|
28
24
|
|
29
|
-
|
30
25
|
class Chef
|
31
26
|
class Platform
|
32
27
|
|
@@ -34,267 +29,7 @@ class Chef
|
|
34
29
|
attr_writer :platforms
|
35
30
|
|
36
31
|
def platforms
|
37
|
-
@platforms ||=
|
38
|
-
require 'chef/providers'
|
39
|
-
|
40
|
-
{
|
41
|
-
:freebsd => {
|
42
|
-
:default => {
|
43
|
-
:group => Chef::Provider::Group::Pw,
|
44
|
-
:user => Chef::Provider::User::Pw,
|
45
|
-
}
|
46
|
-
},
|
47
|
-
:ubuntu => {
|
48
|
-
:default => {
|
49
|
-
:package => Chef::Provider::Package::Apt,
|
50
|
-
:service => Chef::Provider::Service::Debian,
|
51
|
-
},
|
52
|
-
">= 11.10" => {
|
53
|
-
:ifconfig => Chef::Provider::Ifconfig::Debian
|
54
|
-
}
|
55
|
-
# Chef::Provider::Service::Upstart is a candidate to be used in
|
56
|
-
# ubuntu versions >= 13.10 but it currently requires all the
|
57
|
-
# services to have an entry under /etc/init. We need to update it
|
58
|
-
# to use the service ctl apis in order to migrate to using it on
|
59
|
-
# ubuntu >= 13.10.
|
60
|
-
},
|
61
|
-
:gcel => {
|
62
|
-
:default => {
|
63
|
-
:package => Chef::Provider::Package::Apt,
|
64
|
-
:service => Chef::Provider::Service::Debian,
|
65
|
-
}
|
66
|
-
},
|
67
|
-
:linaro => {
|
68
|
-
:default => {
|
69
|
-
:package => Chef::Provider::Package::Apt,
|
70
|
-
:service => Chef::Provider::Service::Debian,
|
71
|
-
}
|
72
|
-
},
|
73
|
-
:raspbian => {
|
74
|
-
:default => {
|
75
|
-
:package => Chef::Provider::Package::Apt,
|
76
|
-
:service => Chef::Provider::Service::Debian,
|
77
|
-
}
|
78
|
-
},
|
79
|
-
:linuxmint => {
|
80
|
-
:default => {
|
81
|
-
:package => Chef::Provider::Package::Apt,
|
82
|
-
:service => Chef::Provider::Service::Upstart,
|
83
|
-
}
|
84
|
-
},
|
85
|
-
:debian => {
|
86
|
-
:default => {
|
87
|
-
:package => Chef::Provider::Package::Apt,
|
88
|
-
:service => Chef::Provider::Service::Debian,
|
89
|
-
},
|
90
|
-
">= 6.0" => {
|
91
|
-
:service => Chef::Provider::Service::Insserv
|
92
|
-
},
|
93
|
-
">= 7.0" => {
|
94
|
-
:ifconfig => Chef::Provider::Ifconfig::Debian
|
95
|
-
}
|
96
|
-
},
|
97
|
-
:xenserver => {
|
98
|
-
:default => {
|
99
|
-
:service => Chef::Provider::Service::Redhat,
|
100
|
-
:package => Chef::Provider::Package::Yum,
|
101
|
-
}
|
102
|
-
},
|
103
|
-
:xcp => {
|
104
|
-
:default => {
|
105
|
-
:service => Chef::Provider::Service::Redhat,
|
106
|
-
:package => Chef::Provider::Package::Yum,
|
107
|
-
}
|
108
|
-
},
|
109
|
-
:centos => {
|
110
|
-
:default => {
|
111
|
-
:service => Chef::Provider::Service::Systemd,
|
112
|
-
:package => Chef::Provider::Package::Yum,
|
113
|
-
:ifconfig => Chef::Provider::Ifconfig::Redhat
|
114
|
-
},
|
115
|
-
"< 7" => {
|
116
|
-
:service => Chef::Provider::Service::Redhat
|
117
|
-
}
|
118
|
-
},
|
119
|
-
:amazon => {
|
120
|
-
:default => {
|
121
|
-
:service => Chef::Provider::Service::Redhat,
|
122
|
-
:package => Chef::Provider::Package::Yum,
|
123
|
-
}
|
124
|
-
},
|
125
|
-
:scientific => {
|
126
|
-
:default => {
|
127
|
-
:service => Chef::Provider::Service::Systemd,
|
128
|
-
:package => Chef::Provider::Package::Yum,
|
129
|
-
},
|
130
|
-
"< 7" => {
|
131
|
-
:service => Chef::Provider::Service::Redhat
|
132
|
-
}
|
133
|
-
},
|
134
|
-
:fedora => {
|
135
|
-
:default => {
|
136
|
-
:service => Chef::Provider::Service::Systemd,
|
137
|
-
:package => Chef::Provider::Package::Yum,
|
138
|
-
:ifconfig => Chef::Provider::Ifconfig::Redhat
|
139
|
-
},
|
140
|
-
"< 15" => {
|
141
|
-
:service => Chef::Provider::Service::Redhat
|
142
|
-
}
|
143
|
-
},
|
144
|
-
:opensuse => {
|
145
|
-
:default => {
|
146
|
-
:service => Chef::Provider::Service::Redhat,
|
147
|
-
:package => Chef::Provider::Package::Zypper,
|
148
|
-
:group => Chef::Provider::Group::Suse
|
149
|
-
},
|
150
|
-
# Only OpenSuSE 12.3+ should use the Usermod group provider:
|
151
|
-
">= 12.3" => {
|
152
|
-
:group => Chef::Provider::Group::Usermod
|
153
|
-
}
|
154
|
-
},
|
155
|
-
:suse => {
|
156
|
-
:default => {
|
157
|
-
:service => Chef::Provider::Service::Systemd,
|
158
|
-
:package => Chef::Provider::Package::Zypper,
|
159
|
-
:group => Chef::Provider::Group::Gpasswd
|
160
|
-
},
|
161
|
-
"< 12.0" => {
|
162
|
-
:group => Chef::Provider::Group::Suse,
|
163
|
-
:service => Chef::Provider::Service::Redhat
|
164
|
-
}
|
165
|
-
},
|
166
|
-
:oracle => {
|
167
|
-
:default => {
|
168
|
-
:service => Chef::Provider::Service::Systemd,
|
169
|
-
:package => Chef::Provider::Package::Yum,
|
170
|
-
},
|
171
|
-
"< 7" => {
|
172
|
-
:service => Chef::Provider::Service::Redhat
|
173
|
-
}
|
174
|
-
},
|
175
|
-
:redhat => {
|
176
|
-
:default => {
|
177
|
-
:service => Chef::Provider::Service::Systemd,
|
178
|
-
:package => Chef::Provider::Package::Yum,
|
179
|
-
:ifconfig => Chef::Provider::Ifconfig::Redhat
|
180
|
-
},
|
181
|
-
"< 7" => {
|
182
|
-
:service => Chef::Provider::Service::Redhat
|
183
|
-
}
|
184
|
-
},
|
185
|
-
:ibm_powerkvm => {
|
186
|
-
:default => {
|
187
|
-
:service => Chef::Provider::Service::Redhat,
|
188
|
-
:package => Chef::Provider::Package::Yum,
|
189
|
-
:ifconfig => Chef::Provider::Ifconfig::Redhat
|
190
|
-
}
|
191
|
-
},
|
192
|
-
:cloudlinux => {
|
193
|
-
:default => {
|
194
|
-
:service => Chef::Provider::Service::Redhat,
|
195
|
-
:package => Chef::Provider::Package::Yum,
|
196
|
-
:ifconfig => Chef::Provider::Ifconfig::Redhat
|
197
|
-
}
|
198
|
-
},
|
199
|
-
:parallels => {
|
200
|
-
:default => {
|
201
|
-
:service => Chef::Provider::Service::Redhat,
|
202
|
-
:package => Chef::Provider::Package::Yum,
|
203
|
-
:ifconfig => Chef::Provider::Ifconfig::Redhat
|
204
|
-
}
|
205
|
-
},
|
206
|
-
:gentoo => {
|
207
|
-
:default => {
|
208
|
-
:package => Chef::Provider::Package::Portage,
|
209
|
-
:service => Chef::Provider::Service::Gentoo,
|
210
|
-
}
|
211
|
-
},
|
212
|
-
:arch => {
|
213
|
-
:default => {
|
214
|
-
:package => Chef::Provider::Package::Pacman,
|
215
|
-
:service => Chef::Provider::Service::Systemd,
|
216
|
-
}
|
217
|
-
},
|
218
|
-
:solaris => {},
|
219
|
-
:openindiana => {
|
220
|
-
:default => {
|
221
|
-
:mount => Chef::Provider::Mount::Solaris,
|
222
|
-
:package => Chef::Provider::Package::Ips,
|
223
|
-
:group => Chef::Provider::Group::Usermod
|
224
|
-
}
|
225
|
-
},
|
226
|
-
:opensolaris => {
|
227
|
-
:default => {
|
228
|
-
:mount => Chef::Provider::Mount::Solaris,
|
229
|
-
:package => Chef::Provider::Package::Ips,
|
230
|
-
:group => Chef::Provider::Group::Usermod
|
231
|
-
}
|
232
|
-
},
|
233
|
-
:nexentacore => {
|
234
|
-
:default => {
|
235
|
-
:mount => Chef::Provider::Mount::Solaris,
|
236
|
-
:package => Chef::Provider::Package::Solaris,
|
237
|
-
:group => Chef::Provider::Group::Usermod
|
238
|
-
}
|
239
|
-
},
|
240
|
-
:omnios => {
|
241
|
-
:default => {
|
242
|
-
:mount => Chef::Provider::Mount::Solaris,
|
243
|
-
:package => Chef::Provider::Package::Ips,
|
244
|
-
:group => Chef::Provider::Group::Usermod,
|
245
|
-
:user => Chef::Provider::User::Solaris,
|
246
|
-
}
|
247
|
-
},
|
248
|
-
:solaris2 => {
|
249
|
-
:default => {
|
250
|
-
:mount => Chef::Provider::Mount::Solaris,
|
251
|
-
:package => Chef::Provider::Package::Ips,
|
252
|
-
:group => Chef::Provider::Group::Usermod,
|
253
|
-
:user => Chef::Provider::User::Solaris,
|
254
|
-
},
|
255
|
-
"< 5.11" => {
|
256
|
-
:mount => Chef::Provider::Mount::Solaris,
|
257
|
-
:package => Chef::Provider::Package::Solaris,
|
258
|
-
:group => Chef::Provider::Group::Usermod,
|
259
|
-
:user => Chef::Provider::User::Solaris,
|
260
|
-
}
|
261
|
-
},
|
262
|
-
:smartos => {
|
263
|
-
:default => {
|
264
|
-
:mount => Chef::Provider::Mount::Solaris,
|
265
|
-
:package => Chef::Provider::Package::SmartOS,
|
266
|
-
:group => Chef::Provider::Group::Usermod
|
267
|
-
}
|
268
|
-
},
|
269
|
-
:hpux => {
|
270
|
-
:default => {
|
271
|
-
:group => Chef::Provider::Group::Usermod
|
272
|
-
}
|
273
|
-
},
|
274
|
-
:aix => {
|
275
|
-
:default => {
|
276
|
-
:group => Chef::Provider::Group::Aix,
|
277
|
-
:mount => Chef::Provider::Mount::Aix,
|
278
|
-
:ifconfig => Chef::Provider::Ifconfig::Aix,
|
279
|
-
:package => Chef::Provider::Package::Aix,
|
280
|
-
:user => Chef::Provider::User::Aix,
|
281
|
-
:service => Chef::Provider::Service::Aix
|
282
|
-
}
|
283
|
-
},
|
284
|
-
:exherbo => {
|
285
|
-
:default => {
|
286
|
-
:package => Chef::Provider::Package::Paludis,
|
287
|
-
:service => Chef::Provider::Service::Systemd,
|
288
|
-
}
|
289
|
-
},
|
290
|
-
:default => {
|
291
|
-
:mount => Chef::Provider::Mount::Mount,
|
292
|
-
:user => Chef::Provider::User::Useradd,
|
293
|
-
:group => Chef::Provider::Group::Gpasswd,
|
294
|
-
:ifconfig => Chef::Provider::Ifconfig,
|
295
|
-
}
|
296
|
-
}
|
297
|
-
end
|
32
|
+
@platforms ||= { default: {} }
|
298
33
|
end
|
299
34
|
|
300
35
|
include Chef::Mixin::ParamsValidate
|
@@ -304,7 +39,7 @@ class Chef
|
|
304
39
|
|
305
40
|
name_sym = name
|
306
41
|
if name.kind_of?(String)
|
307
|
-
name.downcase
|
42
|
+
name = name.downcase
|
308
43
|
name.gsub!(/\s/, "_")
|
309
44
|
name_sym = name.to_sym
|
310
45
|
end
|
@@ -325,8 +60,6 @@ class Chef
|
|
325
60
|
Chef::Log.debug("Chef::Version::Comparable does not know how to parse the platform version: #{version}")
|
326
61
|
end
|
327
62
|
end
|
328
|
-
else
|
329
|
-
Chef::Log.debug("Platform #{name} not found, using all defaults. (Unsupported platform?)")
|
330
63
|
end
|
331
64
|
provider_map
|
332
65
|
end
|
@@ -1,88 +1,25 @@
|
|
1
|
+
require 'singleton'
|
1
2
|
|
2
3
|
class Chef
|
3
4
|
class Platform
|
4
5
|
class ProviderPriorityMap
|
5
6
|
include Singleton
|
6
7
|
|
7
|
-
def initialize
|
8
|
-
load_default_map
|
9
|
-
end
|
10
|
-
|
11
8
|
def get_priority_array(node, resource_name)
|
12
9
|
priority_map.get(node, resource_name.to_sym)
|
13
10
|
end
|
14
11
|
|
15
|
-
def set_priority_array(resource_name, priority_array, *filter)
|
16
|
-
|
12
|
+
def set_priority_array(resource_name, priority_array, *filter, &block)
|
13
|
+
priority_map.set(resource_name.to_sym, Array(priority_array), *filter, &block)
|
17
14
|
end
|
18
15
|
|
19
|
-
|
20
|
-
|
16
|
+
# @api private
|
17
|
+
def list_handlers(node, resource_name)
|
18
|
+
priority_map.list(node, resource_name.to_sym).flatten(1).uniq
|
21
19
|
end
|
22
20
|
|
23
21
|
private
|
24
22
|
|
25
|
-
def load_default_map
|
26
|
-
require 'chef/providers'
|
27
|
-
|
28
|
-
#
|
29
|
-
# Linux
|
30
|
-
#
|
31
|
-
|
32
|
-
# default block for linux O/Sen must come before platform_family exceptions
|
33
|
-
priority :service, [
|
34
|
-
Chef::Provider::Service::Systemd,
|
35
|
-
Chef::Provider::Service::Insserv,
|
36
|
-
Chef::Provider::Service::Redhat,
|
37
|
-
], os: "linux"
|
38
|
-
|
39
|
-
priority :service, [
|
40
|
-
Chef::Provider::Service::Systemd,
|
41
|
-
Chef::Provider::Service::Arch,
|
42
|
-
], platform_family: "arch"
|
43
|
-
|
44
|
-
priority :service, [
|
45
|
-
Chef::Provider::Service::Systemd,
|
46
|
-
Chef::Provider::Service::Gentoo,
|
47
|
-
], platform_family: "gentoo"
|
48
|
-
|
49
|
-
priority :service, [
|
50
|
-
# we can determine what systemd supports accurately
|
51
|
-
Chef::Provider::Service::Systemd,
|
52
|
-
# on debian-ish system if an upstart script exists that must win over sysv types
|
53
|
-
Chef::Provider::Service::Upstart,
|
54
|
-
Chef::Provider::Service::Insserv,
|
55
|
-
Chef::Provider::Service::Debian,
|
56
|
-
Chef::Provider::Service::Invokercd,
|
57
|
-
], platform_family: "debian"
|
58
|
-
|
59
|
-
priority :service, [
|
60
|
-
Chef::Provider::Service::Systemd,
|
61
|
-
Chef::Provider::Service::Insserv,
|
62
|
-
Chef::Provider::Service::Redhat,
|
63
|
-
], platform_family: [ "rhel", "fedora", "suse" ]
|
64
|
-
|
65
|
-
#
|
66
|
-
# BSDen
|
67
|
-
#
|
68
|
-
|
69
|
-
priority :service, Chef::Provider::Service::Freebsd, os: [ "freebsd", "netbsd" ]
|
70
|
-
priority :service, Chef::Provider::Service::Openbsd, os: [ "openbsd" ]
|
71
|
-
|
72
|
-
#
|
73
|
-
# Solaris-en
|
74
|
-
#
|
75
|
-
|
76
|
-
priority :service, Chef::Provider::Service::Solaris, os: "solaris2"
|
77
|
-
|
78
|
-
#
|
79
|
-
# Mac
|
80
|
-
#
|
81
|
-
|
82
|
-
priority :service, Chef::Provider::Service::Macosx, os: "darwin"
|
83
|
-
priority :package, Chef::Provider::Package::Homebrew, os: "darwin"
|
84
|
-
end
|
85
|
-
|
86
23
|
def priority_map
|
87
24
|
require 'chef/node_map'
|
88
25
|
@priority_map ||= Chef::NodeMap.new
|
@@ -39,6 +39,11 @@ class Chef
|
|
39
39
|
is_server_2003
|
40
40
|
end
|
41
41
|
|
42
|
+
def supports_powershell_execution_bypass?(node)
|
43
|
+
node[:languages] && node[:languages][:powershell] &&
|
44
|
+
node[:languages][:powershell][:version].to_i >= 3
|
45
|
+
end
|
46
|
+
|
42
47
|
def supports_dsc?(node)
|
43
48
|
node[:languages] && node[:languages][:powershell] &&
|
44
49
|
node[:languages][:powershell][:version].to_i >= 4
|
@@ -1,33 +1,30 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
1
3
|
class Chef
|
2
4
|
class Platform
|
3
5
|
class ResourcePriorityMap
|
4
6
|
include Singleton
|
5
7
|
|
6
|
-
def
|
7
|
-
|
8
|
+
def get_priority_array(node, resource_name, canonical: nil)
|
9
|
+
priority_map.get(node, resource_name.to_sym, canonical: canonical)
|
8
10
|
end
|
9
11
|
|
10
|
-
def
|
11
|
-
priority_map.
|
12
|
+
def set_priority_array(resource_name, priority_array, *filter, &block)
|
13
|
+
priority_map.set(resource_name.to_sym, Array(priority_array), *filter, &block)
|
12
14
|
end
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
+
# @api private
|
17
|
+
def delete_canonical(resource_name, resource_class)
|
18
|
+
priority_map.delete_canonical(resource_name, resource_class)
|
16
19
|
end
|
17
20
|
|
18
|
-
|
19
|
-
|
21
|
+
# @api private
|
22
|
+
def list_handlers(*args)
|
23
|
+
priority_map.list(*args).flatten(1).uniq
|
20
24
|
end
|
21
25
|
|
22
26
|
private
|
23
27
|
|
24
|
-
def load_default_map
|
25
|
-
require 'chef/resources'
|
26
|
-
|
27
|
-
# MacOSX
|
28
|
-
priority :package, Chef::Resource::HomebrewPackage, os: "darwin"
|
29
|
-
end
|
30
|
-
|
31
28
|
def priority_map
|
32
29
|
require 'chef/node_map'
|
33
30
|
@priority_map ||= Chef::NodeMap.new
|