I'm installing a rails application that uses Passenger and Apaache(httpd). I don't want to compile the module if it's already installed. Unfortunately the not_if option on execute isn't working and I'm not sure why. The file is definitely there. Is there a better way of accomplishing this and/or troubleshooting this?
Here's the code in my recipe:
if node['app']['ruby_version'] == "2.3.3"
gembinary = "/usr/bin/gem"
passengerdir = '/usr'
passengerso = "/usr/lib64/ruby/gems/2.3.0/gems/passenger-#{node['passenger']['package']['version']}/libout/apache2/mod_passenger.so"
else
gembinary = "/opt/ruby-#{node[:app][:ruby_version]}/bin/gem"
passengerdir = "/opt/ruby-#{node[:app][:ruby_version]}"
passengerso = "#{passengerdir}/lib/ruby/gems/#{node[:app][:rubygems_version]}/gems/passenger-#{node['passenger']['package']['version']}/libout/apache2/mod_passenger.so"
end
execute "#{passengerdir}/bin/passenger-install-apache2-module --auto" do
not_if { ::File.exist?(passengerso) }
creates passengerso
end