diff --git a/manifests/passenger/apache/centos/post.pp b/manifests/passenger/apache/centos/post.pp index 40d93f0a..3e77f3f7 100644 --- a/manifests/passenger/apache/centos/post.pp +++ b/manifests/passenger/apache/centos/post.pp @@ -10,10 +10,21 @@ $gempath, $binpath ) { + + if $version > '4.0.0' { + $install_out_directory = 'buildout' + } elsif $version > '3.9.0' { + $install_out_directory = 'libout' + } else { + $install_out_directory = 'ext' + } + + $install_creates = "${rvm::passenger::apache::gempath}/passenger-${rvm::passenger::apache::version}/${install_out_directory}/apache2/mod_passenger.so" + exec { 'passenger-install-apache2-module': command => "${rvm::passenger::apache::binpath}rvm ${rvm::passenger::apache::ruby_version} exec passenger-install-apache2-module -a", - creates => "${rvm::passenger::apache::gempath}/passenger-${rvm::passenger::apache::version}/ext/apache2/mod_passenger.so", + creates => $install_creates, logoutput => 'on_failure', require => [Rvm_gem['passenger'], Package['httpd','httpd-devel','mod_ssl']]; } diff --git a/manifests/passenger/apache/ubuntu/post.pp b/manifests/passenger/apache/ubuntu/post.pp index 87fc72ad..6aa2cb5e 100644 --- a/manifests/passenger/apache/ubuntu/post.pp +++ b/manifests/passenger/apache/ubuntu/post.pp @@ -11,10 +11,20 @@ $binpath ) { + if $version > '4.0.0' { + $install_out_directory = 'buildout' + } elsif $version > '3.9.0' { + $install_out_directory = 'libout' + } else { + $install_out_directory = 'ext' + } + + $install_creates = "${gempath}/passenger-${version}/${install_out_directory}/apache2/mod_passenger.so" + exec { 'passenger-install-apache2-module': command => "${binpath}rvm ${ruby_version} exec passenger-install-apache2-module -a", - creates => "${gempath}/passenger-${version}/ext/apache2/mod_passenger.so", + creates => $install_creates, logoutput => 'on_failure', require => [Rvm_gem['passenger'], Package['apache2', 'build-essential', 'apache2-prefork-dev', 'libapr-dev', 'libaprutil-dev', 'libcurl4-openssl-dev']], @@ -23,7 +33,7 @@ file { '/etc/apache2/mods-available/passenger.load': ensure => file, - content => "LoadModule passenger_module ${gempath}/passenger-${version}/ext/apache2/mod_passenger.so", + content => "LoadModule passenger_module ${install_creates}", require => Exec['passenger-install-apache2-module']; '/etc/apache2/mods-available/passenger.conf': diff --git a/templates/passenger-apache-centos.conf.erb b/templates/passenger-apache-centos.conf.erb index 26304ab3..c85d7bf2 100644 --- a/templates/passenger-apache-centos.conf.erb +++ b/templates/passenger-apache-centos.conf.erb @@ -1,8 +1,4 @@ -<% if version >= '3.9.0' %> -LoadModule passenger_module <%= @gempath %>/passenger-<%= @version %>/libout/apache2/mod_passenger.so -<% else %> -LoadModule passenger_module <%= @gempath %>/passenger-<%= @version %>/ext/apache2/mod_passenger.so -<% end %> +LoadModule passenger_module <%= @install_creates %> PassengerRoot <%= @gempath %>/passenger-<%= @version %>