Skip to content

Commit

Permalink
allow options passing to package provider
Browse files Browse the repository at this point in the history
  • Loading branch information
scalp42 authored and martinb3 committed Jul 16, 2015
1 parent d6ce0fc commit 0d62ed3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/provider_install_package.rb
Expand Up @@ -14,9 +14,10 @@ def action_install
package_url = get_package_url(new_resource, node)
filename = package_url.split('/').last
checksum = get_package_checksum(new_resource, node)
package_options = new_resource.package_options

download_package(package_url, "#{Chef::Config[:file_cache_path]}/#{filename}", checksum)
install_package("#{Chef::Config[:file_cache_path]}/#{filename}")
install_package("#{Chef::Config[:file_cache_path]}/#{filename}", package_options)
end
end
end
Expand Down Expand Up @@ -49,8 +50,9 @@ def download_package(url, path, checksum)
end
end

def install_package(path)
def install_package(path, package_options)
package path do
options package_options
action :install
end
end
Expand Down
1 change: 1 addition & 0 deletions libraries/resource_install.rb
Expand Up @@ -15,6 +15,7 @@ class Resource::ElasticsearchInstall < Resource
# attributes used by the package-flavor provider
attribute(:package_url, kind_of: String, default: nil)
attribute(:package_checksum, kind_of: String, default: nil)
attribute(:package_options, kind_of: String, default: nil)

# attributes used by the source-flavor provider
attribute(:source_url, kind_of: String, default: lazy { "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-#{version}.tar.gz" } )
Expand Down

0 comments on commit 0d62ed3

Please sign in to comment.