Class: Chef::Provider::Package::Windows
- Inherits:
-
Chef::Provider::Package
- Object
- Chef::Provider
- Chef::Provider::Package
- Chef::Provider::Package::Windows
- Defined in:
- lib/chef/provider/package/windows.rb,
lib/chef/provider/package/windows/msi.rb
Defined Under Namespace
Classes: MSI
Constant Summary
Constants included from Mixin::ShellOut
Mixin::ShellOut::DEPRECATED_OPTIONS
Instance Attribute Summary
Attributes inherited from Chef::Provider::Package
Attributes inherited from Chef::Provider
#action, #cookbook_name, #current_resource, #new_resource, #recipe_name, #run_context
Instance Method Summary collapse
-
#install_package(name, version) ⇒ Object
Chef::Provider::Package action_install + action_remove call install_package + remove_package Pass those calls to the correct sub-provider.
- #installer_type ⇒ Object
-
#load_current_resource ⇒ Object
load_current_resource is run in Chef::Provider#run_action when not in whyrun_mode?.
- #package_provider ⇒ Object
- #remove_package(name, version) ⇒ Object
Methods inherited from Chef::Provider::Package
#action_install, #action_purge, #action_reconfig, #action_remove, #action_upgrade, #define_resource_requirements, #expand_options, #get_preseed_file, #initialize, #preseed_package, #preseed_resource, #purge_package, #reconfig_package, #removing_package?, #target_version_already_installed?, #upgrade_package, #whyrun_supported?
Methods included from Mixin::Command
#chdir_or_tmpdir, #handle_command_failures, #output_of_command, #run_command, #run_command_and_return_stdout_stderr, #run_command_with_systems_locale
Methods included from Mixin::Command::Windows
Methods included from Mixin::Command::Unix
Methods inherited from Chef::Provider
#action_nothing, #cleanup_after_converge, #converge_by, #define_resource_requirements, #events, #initialize, #node, node_map, #process_resource_requirements, provides, provides?, #requirements, #resource_collection, #resource_updated?, #run_action, #set_updated_status, supports?, #whyrun_mode?, #whyrun_supported?
Methods included from Mixin::DescendantsTracker
#descendants, descendants, direct_descendants, #direct_descendants, find_descendants_by_name, #find_descendants_by_name, #inherited, store_inherited
Methods included from Mixin::ShellOut
#run_command_compatible_options, #shell_out, #shell_out!, #shell_out_with_systems_locale, #shell_out_with_systems_locale!
Constructor Details
This class inherits a constructor from Chef::Provider::Package
Instance Method Details
#install_package(name, version) ⇒ Object
Chef::Provider::Package action_install + action_remove call install_package + remove_package Pass those calls to the correct sub-provider
76 77 78 |
# File 'lib/chef/provider/package/windows.rb', line 76 def install_package(name, version) package_provider.install_package(name, version) end |
#installer_type ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/chef/provider/package/windows.rb', line 58 def installer_type @installer_type ||= begin if @new_resource.installer_type @new_resource.installer_type else file_extension = ::File.basename(@new_resource.source).split(".").last.downcase if file_extension == "msi" :msi else raise ArgumentError, "Installer type for Windows Package '#{@new_resource.name}' not specified and cannot be determined from file extension '#{file_extension}'" end end end end |
#load_current_resource ⇒ Object
load_current_resource is run in Chef::Provider#run_action when not in whyrun_mode?
38 39 40 41 42 43 44 45 |
# File 'lib/chef/provider/package/windows.rb', line 38 def load_current_resource @new_resource.source(Chef::Util::PathHelper.validate_path(@new_resource.source)) @current_resource = Chef::Resource::WindowsPackage.new(@new_resource.name) @current_resource.version(package_provider.installed_version) @new_resource.version(package_provider.package_version) @current_resource end |
#package_provider ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/chef/provider/package/windows.rb', line 47 def package_provider @package_provider ||= begin case installer_type when :msi Chef::Provider::Package::Windows::MSI.new(@new_resource) else raise "Unable to find a Chef::Provider::Package::Windows provider for installer_type '#{installer_type}'" end end end |
#remove_package(name, version) ⇒ Object
80 81 82 |
# File 'lib/chef/provider/package/windows.rb', line 80 def remove_package(name, version) package_provider.remove_package(name, version) end |