remote_file "#{Chef::Config[:file_cache_path]}/#{details['rpm_file']}" do
source "http://downloads.mysql.com/archives/mysql-5.5/#{details['rpm_file']}"
notifies :install, "yum_package[#{name}]", :immediately
# If the package is already installed, don't bother downloading it
not_if "rpm -qa | grep -i #{name.gsub('.rpm', '')}"
end
yum_package name do
source "#{Chef::Config[:file_cache_path]}/#{details['rpm_file']}"
options "--nogpgcheck"
not_if "rpm -qa | grep -i #{name.gsub('.rpm', '')}"
action :nothing
end
Remote-file -block doesn't get run when the files already exist on the fs, and though yum installation doesn't get triggered. Better solutions would be to check the files and check if they are installed.
remote_file "#{Chef::Config[:file_cache_path]}/#{details['rpm_file']}" do
source "http://downloads.mysql.com/archives/mysql-5.5/#{details['rpm_file']}"
# If the package is already installed, don't bother downloading it
not_if { File.exist?("#{Chef::Config[:file_cache_path]}/#{details['rpm_file']}") }
end
yum_package name do
source "#{Chef::Config[:file_cache_path]}/#{details['rpm_file']}"
options "--nogpgcheck"
not_if "rpm -qa | grep -i #{name.gsub('.rpm', '')}"
action :install
end
Hey @n1koo, I'm not sure I'm understanding the issue here (apologies). Is the issue only when using Vagrant-cachier or do you see this outside of that as well?
Remote-file -block doesn't get run when the files already exist on the fs, and though yum installation doesn't get triggered. Better solutions would be to check the files and check if they are installed.