我为redisio community cookbook创建了一个包装器食谱,我想覆盖download_dir
的{{1}}属性:
resources/install.rb
由于attribute :download_dir, :kind_of => String, :default => Chef::Config[:file_cache_path]
它正在运行chef-client运行的路径(/ var / chef / cache)。问题在于file_cache_path
(redisio cookbook),因为只有attributes/default.rb
在我指定的文件夹中创建一个bin,如下所示:
install_dir
答案 0 :(得分:2)
您可以自行调用redisio_install
提供商并提供download_dir
选项,而不是包含install recipe,而不是{{3}}。使用
include_recipe 'redisio::_install_prereqs'
include_recipe 'build-essential::default'
redis = node['redisio']
location = "#{redis['mirror']}/#{redis['base_name']}#{redis['version']}.#{redis['artifact_type']}"
redisio_install "redis-installation" do
version redis['version'] if redis['version']
download_url location
safe_install redis['safe_install']
install_dir redis['install_dir'] if redis['install_dir']
download_dir "/tmp"
end