diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-10-24 10:45:43 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-10-24 10:45:43 -0700 |
commit | 97aaf5bbcdfd0810722b123bdc67e883a7ca8077 (patch) | |
tree | 25663bf1d4f53664b96844251091b51273ad84c7 /lib/chef/resource | |
parent | cb1bcb1f08816f551f96e713624718f58da3c9b3 (diff) | |
download | chef-97aaf5bbcdfd0810722b123bdc67e883a7ca8077.tar.gz |
Chef-12 RC Provider Resolver
makes resource and provider class resolution more dynamic.
begins deprecation of Chef::Platform static mapping.
Diffstat (limited to 'lib/chef/resource')
45 files changed, 75 insertions, 54 deletions
diff --git a/lib/chef/resource/apt_package.rb b/lib/chef/resource/apt_package.rb index 050cf838ae..f944825ac3 100644 --- a/lib/chef/resource/apt_package.rb +++ b/lib/chef/resource/apt_package.rb @@ -23,10 +23,12 @@ class Chef class Resource class AptPackage < Chef::Resource::Package + provides :apt_package + provides :package, os: "linux", platform_family: [ "debian" ] + def initialize(name, run_context=nil) super @resource_name = :apt_package - @provider = Chef::Provider::Package::Apt @default_release = nil end diff --git a/lib/chef/resource/bash.rb b/lib/chef/resource/bash.rb index c56de5fe20..0add0ce501 100644 --- a/lib/chef/resource/bash.rb +++ b/lib/chef/resource/bash.rb @@ -17,6 +17,7 @@ # require 'chef/resource/script' +require 'chef/provider/script' class Chef class Resource diff --git a/lib/chef/resource/bff_package.rb b/lib/chef/resource/bff_package.rb index 2d78483e4b..917f0d1d50 100644 --- a/lib/chef/resource/bff_package.rb +++ b/lib/chef/resource/bff_package.rb @@ -26,7 +26,6 @@ class Chef def initialize(name, run_context=nil) super @resource_name = :bff_package - @provider = Chef::Provider::Package::Aix end end diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb index 83c397bd5b..b2210262d2 100644 --- a/lib/chef/resource/breakpoint.rb +++ b/lib/chef/resource/breakpoint.rb @@ -28,7 +28,7 @@ class Chef super(@name, *args) @action = "break" @allowed_actions << :break - @provider = Chef::Provider::Breakpoint + @resource_name = :breakpoint end end end diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb index af45cb93e6..b4ead11f1d 100644 --- a/lib/chef/resource/chef_gem.rb +++ b/lib/chef/resource/chef_gem.rb @@ -23,13 +23,12 @@ class Chef class Resource class ChefGem < Chef::Resource::Package::GemPackage - provides :chef_gem, :on_platforms => :all + provides :chef_gem def initialize(name, run_context=nil) super @resource_name = :chef_gem @gem_binary = RbConfig::CONFIG['bindir'] + "/gem" - @provider = Chef::Provider::Package::Rubygems end # The chef_gem resources is for installing gems to the current gem environment only for use by Chef cookbooks. diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb index 2709cf64f4..7be353b648 100644 --- a/lib/chef/resource/cookbook_file.rb +++ b/lib/chef/resource/cookbook_file.rb @@ -27,7 +27,7 @@ class Chef class CookbookFile < Chef::Resource::File include Chef::Mixin::Securable - provides :cookbook_file, :on_platforms => :all + provides :cookbook_file def initialize(name, run_context=nil) super @@ -36,7 +36,6 @@ class Chef @action = "create" @source = ::File.basename(name) @cookbook = nil - @provider = Chef::Provider::CookbookFile end def source(source_filename=nil) diff --git a/lib/chef/resource/csh.rb b/lib/chef/resource/csh.rb index 95aa8afd7a..36659c349b 100644 --- a/lib/chef/resource/csh.rb +++ b/lib/chef/resource/csh.rb @@ -17,6 +17,7 @@ # require 'chef/resource/script' +require 'chef/provider/script' class Chef class Resource diff --git a/lib/chef/resource/deploy.rb b/lib/chef/resource/deploy.rb index a08e8aeeea..4252aa230f 100644 --- a/lib/chef/resource/deploy.rb +++ b/lib/chef/resource/deploy.rb @@ -77,7 +77,6 @@ class Chef @shallow_clone = false @scm_provider = Chef::Provider::Git @svn_force_export = false - @provider = Chef::Provider::Deploy::Timestamped @allowed_actions.push(:force_deploy, :deploy, :rollback) @additional_remotes = Hash[] @keep_releases = 5 diff --git a/lib/chef/resource/deploy_revision.rb b/lib/chef/resource/deploy_revision.rb index ceac26e91a..e144ce2162 100644 --- a/lib/chef/resource/deploy_revision.rb +++ b/lib/chef/resource/deploy_revision.rb @@ -22,14 +22,19 @@ class Chef # Convenience class for using the deploy resource with the revision # deployment strategy (provider) class DeployRevision < Chef::Resource::Deploy + + provides :deploy_revision + def initialize(*args, &block) super @resource_name = :deploy_revision - @provider = Chef::Provider::Deploy::Revision end end class DeployBranch < Chef::Resource::DeployRevision + + provides :deploy_branch + def initialize(*args, &block) super @resource_name = :deploy_branch diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb index 423c0bbe27..1ab7f0d16d 100644 --- a/lib/chef/resource/directory.rb +++ b/lib/chef/resource/directory.rb @@ -32,7 +32,7 @@ class Chef include Chef::Mixin::Securable - provides :directory, :on_platforms => :all + provides :directory def initialize(name, run_context=nil) super @@ -41,7 +41,6 @@ class Chef @action = :create @recursive = false @allowed_actions.push(:create, :delete) - @provider = Chef::Provider::Directory end def recursive(arg=nil) diff --git a/lib/chef/resource/dpkg_package.rb b/lib/chef/resource/dpkg_package.rb index 2fb5b5c249..35a47e8a82 100644 --- a/lib/chef/resource/dpkg_package.rb +++ b/lib/chef/resource/dpkg_package.rb @@ -23,10 +23,11 @@ class Chef class Resource class DpkgPackage < Chef::Resource::Package + provides :dpkg_package, os: "linux" + def initialize(name, run_context=nil) super @resource_name = :dpkg_package - @provider = Chef::Provider::Package::Dpkg end end diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb index 76ac6659d6..82907c25db 100644 --- a/lib/chef/resource/dsc_script.rb +++ b/lib/chef/resource/dsc_script.rb @@ -22,13 +22,12 @@ class Chef class Resource class DscScript < Chef::Resource - provides :dsc_script, :on_platforms => ["windows"] + provides :dsc_script, platform: "windows" def initialize(name, run_context=nil) super @allowed_actions.push(:run) @action = :run - @provider = Chef::Provider::DscScript @resource_name = :dsc_script end diff --git a/lib/chef/resource/easy_install_package.rb b/lib/chef/resource/easy_install_package.rb index f25e1ac22f..5286e9a289 100644 --- a/lib/chef/resource/easy_install_package.rb +++ b/lib/chef/resource/easy_install_package.rb @@ -22,10 +22,11 @@ class Chef class Resource class EasyInstallPackage < Chef::Resource::Package + provides :easy_install_package + def initialize(name, run_context=nil) super @resource_name = :easy_install_package - @provider = Chef::Provider::Package::EasyInstall end def easy_install_binary(arg=nil) diff --git a/lib/chef/resource/erl_call.rb b/lib/chef/resource/erl_call.rb index 959856af66..24009d51c7 100644 --- a/lib/chef/resource/erl_call.rb +++ b/lib/chef/resource/erl_call.rb @@ -18,6 +18,7 @@ # require 'chef/resource' +require 'chef/provider/erl_call' class Chef class Resource diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb index ae118b1c9e..980035b079 100644 --- a/lib/chef/resource/execute.rb +++ b/lib/chef/resource/execute.rb @@ -18,6 +18,7 @@ # require 'chef/resource' +require 'chef/provider/execute' class Chef class Resource diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb index 3c1f4785ef..16491f9bc8 100644 --- a/lib/chef/resource/file.rb +++ b/lib/chef/resource/file.rb @@ -19,7 +19,6 @@ require 'chef/resource' require 'chef/platform/query_helpers' -require 'chef/provider/file' require 'chef/mixin/securable' class Chef @@ -38,7 +37,7 @@ class Chef attr_writer :checksum - provides :file, :on_platforms => :all + provides :file def initialize(name, run_context=nil) super @@ -47,7 +46,6 @@ class Chef @backup = 5 @action = "create" @allowed_actions.push(:create, :delete, :touch, :create_if_missing) - @provider = Chef::Provider::File @atomic_update = Chef::Config[:file_atomic_update] @force_unlink = false @manage_symlink_source = nil diff --git a/lib/chef/resource/freebsd_package.rb b/lib/chef/resource/freebsd_package.rb index 957c25caf1..9c8db506f8 100644 --- a/lib/chef/resource/freebsd_package.rb +++ b/lib/chef/resource/freebsd_package.rb @@ -29,7 +29,7 @@ class Chef class FreebsdPackage < Chef::Resource::Package include Chef::Mixin::ShellOut - provides :package, :on_platforms => ["freebsd"] + provides :package, platform: "freebsd" def initialize(name, run_context=nil) super diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb index 6def7b6653..631aa13f56 100644 --- a/lib/chef/resource/gem_package.rb +++ b/lib/chef/resource/gem_package.rb @@ -22,10 +22,11 @@ class Chef class Resource class GemPackage < Chef::Resource::Package + provides :gem_package + def initialize(name, run_context=nil) super @resource_name = :gem_package - @provider = Chef::Provider::Package::Rubygems end def source(arg=nil) diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb index 774bb24f24..7156873315 100644 --- a/lib/chef/resource/git.rb +++ b/lib/chef/resource/git.rb @@ -22,10 +22,11 @@ class Chef class Resource class Git < Chef::Resource::Scm + provides :git + def initialize(name, run_context=nil) super @resource_name = :git - @provider = Chef::Provider::Git @additional_remotes = Hash[] end diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb index e1d50c1739..952552e3a8 100644 --- a/lib/chef/resource/homebrew_package.rb +++ b/lib/chef/resource/homebrew_package.rb @@ -25,10 +25,11 @@ class Chef class Resource class HomebrewPackage < Chef::Resource::Package + provides :homebrew_package, os: "mac_os_x" + def initialize(name, run_context=nil) super @resource_name = :homebrew_package - @provider = Chef::Provider::Package::Homebrew @homebrew_user = nil end diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb index 47f6286fb4..ccb0a26629 100644 --- a/lib/chef/resource/http_request.rb +++ b/lib/chef/resource/http_request.rb @@ -18,6 +18,7 @@ # require 'chef/resource' +require 'chef/provider/http_request' class Chef class Resource diff --git a/lib/chef/resource/ips_package.rb b/lib/chef/resource/ips_package.rb index 88c6e9a538..77b3387946 100644 --- a/lib/chef/resource/ips_package.rb +++ b/lib/chef/resource/ips_package.rb @@ -22,10 +22,12 @@ require 'chef/provider/package/ips' class Chef class Resource class IpsPackage < ::Chef::Resource::Package + + provides :ips_package, os: "solaris2" + def initialize(name, run_context = nil) super(name, run_context) @resource_name = :ips_package - @provider = Chef::Provider::Package::Ips @allowed_actions = [ :install, :remove, :upgrade ] @accept_license = false end diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb index e53b386a74..8726eded1d 100644 --- a/lib/chef/resource/link.rb +++ b/lib/chef/resource/link.rb @@ -25,7 +25,7 @@ class Chef class Link < Chef::Resource include Chef::Mixin::Securable - provides :link, :on_platform => :all + provides :link identity_attr :target_file @@ -40,7 +40,6 @@ class Chef @link_type = :symbolic @target_file = name @allowed_actions.push(:create, :delete) - @provider = Chef::Provider::Link end def to(arg=nil) diff --git a/lib/chef/resource/log.rb b/lib/chef/resource/log.rb index 391c3b5393..7f970a87a4 100644 --- a/lib/chef/resource/log.rb +++ b/lib/chef/resource/log.rb @@ -16,6 +16,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +require 'chef/resource' +require 'chef/provider/log' + class Chef class Resource class Log < Chef::Resource diff --git a/lib/chef/resource/macports_package.rb b/lib/chef/resource/macports_package.rb index c9434c9e69..bdc8698155 100644 --- a/lib/chef/resource/macports_package.rb +++ b/lib/chef/resource/macports_package.rb @@ -19,10 +19,12 @@ class Chef class Resource class MacportsPackage < Chef::Resource::Package + + provides :macports_package, os: "mac_os_x" + def initialize(name, run_context=nil) super @resource_name = :macports_package - @provider = Chef::Provider::Package::Macports end end end diff --git a/lib/chef/resource/pacman_package.rb b/lib/chef/resource/pacman_package.rb index 2894e415ac..4c45dd004f 100644 --- a/lib/chef/resource/pacman_package.rb +++ b/lib/chef/resource/pacman_package.rb @@ -22,10 +22,11 @@ class Chef class Resource class PacmanPackage < Chef::Resource::Package + provides :pacman_package, os: "linux" + def initialize(name, run_context=nil) super @resource_name = :pacman_package - @provider = Chef::Provider::Package::Pacman end end diff --git a/lib/chef/resource/paludis_package.rb b/lib/chef/resource/paludis_package.rb index fde25e69b3..7eddf8690b 100644 --- a/lib/chef/resource/paludis_package.rb +++ b/lib/chef/resource/paludis_package.rb @@ -22,10 +22,12 @@ require 'chef/provider/package/paludis' class Chef class Resource class PaludisPackage < Chef::Resource::Package + + provides :paludis_package, os: "linux" + def initialize(name, run_context=nil) super(name, run_context) @resource_name = :paludis_package - @provider = Chef::Provider::Package::Paludis @allowed_actions = [ :install, :remove, :upgrade ] @timeout = 3600 end diff --git a/lib/chef/resource/perl.rb b/lib/chef/resource/perl.rb index 546f639e1f..c4bdb6e130 100644 --- a/lib/chef/resource/perl.rb +++ b/lib/chef/resource/perl.rb @@ -17,6 +17,7 @@ # require 'chef/resource/script' +require 'chef/provider/script' class Chef class Resource diff --git a/lib/chef/resource/python.rb b/lib/chef/resource/python.rb index f340afdb39..b1f23d13ce 100644 --- a/lib/chef/resource/python.rb +++ b/lib/chef/resource/python.rb @@ -1,4 +1,3 @@ -# # Author:: Adam Jacob (<adam@opscode.com>) # Copyright:: Copyright (c) 2008 Opscode, Inc. # License:: Apache License, Version 2.0 @@ -17,6 +16,7 @@ # require 'chef/resource/script' +require 'chef/provider/script' class Chef class Resource diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb index 0f7e0eb5de..d4108da47a 100644 --- a/lib/chef/resource/remote_directory.rb +++ b/lib/chef/resource/remote_directory.rb @@ -26,7 +26,7 @@ class Chef class RemoteDirectory < Chef::Resource::Directory include Chef::Mixin::Securable - provides :remote_directory, :on_platforms => :all + provides :remote_directory identity_attr :path @@ -48,7 +48,6 @@ class Chef @overwrite = true @allowed_actions.push(:create, :create_if_missing, :delete) @cookbook = nil - @provider = Chef::Provider::RemoteDirectory end if Chef::Platform.windows? diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb index 6334b1bf44..46516fd3fb 100644 --- a/lib/chef/resource/remote_file.rb +++ b/lib/chef/resource/remote_file.rb @@ -26,7 +26,7 @@ class Chef class RemoteFile < Chef::Resource::File include Chef::Mixin::Securable - provides :remote_file, :on_platforms => :all + provides :remote_file def initialize(name, run_context=nil) super diff --git a/lib/chef/resource/rpm_package.rb b/lib/chef/resource/rpm_package.rb index 200a9633ce..8634f1e25d 100644 --- a/lib/chef/resource/rpm_package.rb +++ b/lib/chef/resource/rpm_package.rb @@ -23,10 +23,11 @@ class Chef class Resource class RpmPackage < Chef::Resource::Package + provides :rpm_package, os: [ "linux", "aix" ] + def initialize(name, run_context=nil) super @resource_name = :rpm_package - @provider = Chef::Provider::Package::Rpm end end diff --git a/lib/chef/resource/ruby.rb b/lib/chef/resource/ruby.rb index 605d27b00d..2b2aa0249d 100644 --- a/lib/chef/resource/ruby.rb +++ b/lib/chef/resource/ruby.rb @@ -17,6 +17,7 @@ # require 'chef/resource/script' +require 'chef/provider/script' class Chef class Resource diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb index d9b8954a90..a9cbf234cf 100644 --- a/lib/chef/resource/ruby_block.rb +++ b/lib/chef/resource/ruby_block.rb @@ -17,6 +17,9 @@ # limitations under the License. # +require 'chef/resource' +require 'chef/provider/ruby_block' + class Chef class Resource class RubyBlock < Chef::Resource diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb index ff7d23f075..479295922c 100644 --- a/lib/chef/resource/script.rb +++ b/lib/chef/resource/script.rb @@ -18,6 +18,7 @@ # require 'chef/resource/execute' +require 'chef/provider/script' class Chef class Resource diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index 4d64c3e3f4..36df7c859a 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -46,10 +46,6 @@ class Chef @action = "nothing" @supports = { :restart => false, :reload => false, :status => false } @allowed_actions.push(:enable, :disable, :start, :stop, :restart, :reload) - - if(run_context && run_context.node[:init_package] == "systemd") - @provider = Chef::Provider::Service::Systemd - end end def service_name(arg=nil) diff --git a/lib/chef/resource/smartos_package.rb b/lib/chef/resource/smartos_package.rb index 0f4f6d8b0a..99b3b953b0 100644 --- a/lib/chef/resource/smartos_package.rb +++ b/lib/chef/resource/smartos_package.rb @@ -23,16 +23,15 @@ class Chef class Resource class SmartosPackage < Chef::Resource::Package + provides :smartos_package + provides :package, os: "solaris2", platform_family: "smartos" + def initialize(name, run_context=nil) super @resource_name = :smartos_package - @provider = Chef::Provider::Package::SmartOS end end end end -# Backwards compatability -# @todo remove in Chef 12 -Chef::Resource::SmartOSPackage = Chef::Resource::SmartosPackage diff --git a/lib/chef/resource/solaris_package.rb b/lib/chef/resource/solaris_package.rb index 3513703076..94be4693b6 100644 --- a/lib/chef/resource/solaris_package.rb +++ b/lib/chef/resource/solaris_package.rb @@ -24,10 +24,16 @@ class Chef class Resource class SolarisPackage < Chef::Resource::Package + provides :solaris_package + provides :package, os: "solaris2", platform_family: "nexentacore" + provides :package, os: "solaris2", platform_family: "solaris2" do |node| + # on >= Solaris 11 we default to IPS packages instead + node[:platform_version].to_f <= 5.10 + end + def initialize(name, run_context=nil) super @resource_name = :solaris_package - @provider = Chef::Provider::Package::Solaris end end diff --git a/lib/chef/resource/subversion.rb b/lib/chef/resource/subversion.rb index 44158cb080..3afbe0baaf 100644 --- a/lib/chef/resource/subversion.rb +++ b/lib/chef/resource/subversion.rb @@ -28,7 +28,6 @@ class Chef @svn_arguments = '--no-auth-cache' @svn_info_args = '--no-auth-cache' @resource_name = :subversion - @provider = Chef::Provider::Subversion allowed_actions << :force_export end diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb index 8473f5b677..8c9607ee07 100644 --- a/lib/chef/resource/template.rb +++ b/lib/chef/resource/template.rb @@ -27,7 +27,7 @@ class Chef class Template < Chef::Resource::File include Chef::Mixin::Securable - provides :template, :on_platforms => :all + provides :template attr_reader :inline_helper_blocks attr_reader :inline_helper_modules @@ -40,7 +40,6 @@ class Chef @cookbook = nil @local = false @variables = Hash.new - @provider = Chef::Provider::Template @inline_helper_blocks = {} @inline_helper_modules = [] @helper_modules = [] diff --git a/lib/chef/resource/timestamped_deploy.rb b/lib/chef/resource/timestamped_deploy.rb index 4032ae9854..b2109db85c 100644 --- a/lib/chef/resource/timestamped_deploy.rb +++ b/lib/chef/resource/timestamped_deploy.rb @@ -18,13 +18,12 @@ class Chef class Resource - # Convenience class for using the deploy resource with the timestamped # deployment strategy (provider) class TimestampedDeploy < Chef::Resource::Deploy + provides :timestamped_deploy def initialize(*args, &block) super(*args, &block) - @provider = Chef::Provider::Deploy::Timestamped end end end diff --git a/lib/chef/resource/whyrun_safe_ruby_block.rb b/lib/chef/resource/whyrun_safe_ruby_block.rb index ddb9d91dc3..6fa5383f5d 100644 --- a/lib/chef/resource/whyrun_safe_ruby_block.rb +++ b/lib/chef/resource/whyrun_safe_ruby_block.rb @@ -23,7 +23,6 @@ class Chef def initialize(name, run_context=nil) super @resource_name = :whyrun_safe_ruby_block - @provider = Chef::Provider::WhyrunSafeRubyBlock end end diff --git a/lib/chef/resource/windows_package.rb b/lib/chef/resource/windows_package.rb index 8bd41e0cb7..c563ba5fdc 100644 --- a/lib/chef/resource/windows_package.rb +++ b/lib/chef/resource/windows_package.rb @@ -24,12 +24,11 @@ class Chef class Resource class WindowsPackage < Chef::Resource::Package - provides :package, :on_platforms => ["windows"] + provides :package, platform: "windows" def initialize(name, run_context=nil) super @allowed_actions = [ :install, :remove ] - @provider = Chef::Provider::Package::Windows @resource_name = :windows_package @source ||= source(@package_name) @@ -76,4 +75,3 @@ class Chef end end end - diff --git a/lib/chef/resource/windows_service.rb b/lib/chef/resource/windows_service.rb index 5ed8e76cbd..49495117ee 100644 --- a/lib/chef/resource/windows_service.rb +++ b/lib/chef/resource/windows_service.rb @@ -25,7 +25,7 @@ class Chef # Until #1773 is resolved, you need to manually specify the windows_service resource # to use action :configure_startup and attribute startup_type - # provides :service, :on_platforms => ["windows"] + provides :service, platform: "windows" identity_attr :service_name @@ -34,7 +34,6 @@ class Chef def initialize(name, run_context=nil) super @resource_name = :windows_service - @provider = Chef::Provider::Service::Windows @allowed_actions.push(:configure_startup) @startup_type = :automatic end diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb index dff70bcf62..8fbca9b097 100644 --- a/lib/chef/resource/yum_package.rb +++ b/lib/chef/resource/yum_package.rb @@ -23,10 +23,12 @@ class Chef class Resource class YumPackage < Chef::Resource::Package + provides :yum_package + provides :package, os: "linux", platform_family: [ "rhel", "fedora" ] + def initialize(name, run_context=nil) super @resource_name = :yum_package - @provider = Chef::Provider::Package::Yum @flush_cache = { :before => false, :after => false } @allow_downgrade = false end |