This repository was archived by the owner on Jun 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
Added support for centos-7, and fixed quite a lot bugs. #87
Open
ashish1099
wants to merge
1
commit into
puppetlabs-toy-chest:master
Choose a base branch
from
ashish1099:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,24 +10,9 @@ | |
# [*passenger_ruby*] | ||
# The path to ruby on your system | ||
# | ||
# [*gem_path*] | ||
# The path to rubygems on your system | ||
# | ||
# [*gem_binary_path*] | ||
# Path to Rubygems binaries on your system | ||
# | ||
# [*passenger_root*] | ||
# The passenger gem root directory | ||
# | ||
# [*mod_passenger_location*] | ||
# Path to Passenger's mod_passenger.so file | ||
# | ||
# [*passenger_provider*] | ||
# The package provider to use for the system | ||
# | ||
# [*passenger_package*] | ||
# The name of the Passenger package | ||
# | ||
# [*include_build_tools*] | ||
# Boolean to require gcc and make classes. Default is false. | ||
# | ||
|
@@ -36,11 +21,7 @@ | |
# class { 'passenger': | ||
# passenger_version => '3.0.21', | ||
# passenger_ruby => '/usr/bin/ruby' | ||
# gem_path => '/var/lib/gems/1.8/gems', | ||
# gem_binary_path => '/var/lib/gems/1.8/bin', | ||
# passenger_root => '/var/lib/gems/1.8/gems/passenger-3.0.21' | ||
# mod_passenger_location => '/var/lib/gems/1.8/gems/passenger-3.0.21/ext/apache2/mod_passenger.so', | ||
# passenger_provider => 'gem', | ||
# packge_provider => 'gem', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo packge_provider -> package_provider |
||
# passenger_package => 'passenger', | ||
# include_build_tools => 'true', | ||
# } | ||
|
@@ -55,29 +36,24 @@ | |
# - make | ||
# | ||
class passenger ( | ||
$gem_binary_path = $passenger::params::gem_binary_path, | ||
$gem_path = $passenger::params::gem_path, | ||
$mod_passenger_location = $passenger::params::mod_passenger_location, | ||
$package_name = $passenger::params::package_name, | ||
$package_ensure = $passenger::params::package_ensure, | ||
$package_provider = $passenger::params::package_provider, | ||
$passenger_package = $passenger::params::passenger_package, | ||
$passenger_provider = $passenger::params::passenger_provider, | ||
$passenger_root = $passenger::params::passenger_root, | ||
$passenger_ruby = $passenger::params::passenger_ruby, | ||
$passenger_version = $passenger::params::passenger_version, | ||
$passenger_ruby = $passenger::params::passenger_ruby, | ||
$package_provider = $passenger::params::package_provider, | ||
$compile_passenger = $passenger::params::compile_passenger, | ||
$include_build_tools = false, | ||
$passenger_package = $passenger::params::passenger_package, | ||
$include_build_tools = false | ||
) inherits passenger::params { | ||
|
||
include '::apache' | ||
include '::apache::dev' | ||
|
||
include '::passenger::options' | ||
include '::passenger::install' | ||
include '::passenger::config' | ||
|
||
if $compile_passenger { | ||
class { '::passenger::compile': } | ||
Class['passenger::options'] -> | ||
Class['passenger::install'] -> | ||
Class['passenger::compile'] -> | ||
Class['passenger::config'] | ||
|
@@ -102,8 +78,7 @@ | |
Anchor['passenger::begin'] -> | ||
Class['apache::dev'] -> | ||
Class['passenger::install'] -> | ||
Class['passenger::compile'] -> | ||
Class['passenger::config'] -> | ||
Anchor['passenger::end'] | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
class passenger::install { | ||
|
||
package { 'passenger': | ||
ensure => $passenger::package_ensure, | ||
name => $passenger::package_name, | ||
ensure => $passenger::passenger_version, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this line the only actual fix for MODULES-2072? |
||
provider => $passenger::package_provider, | ||
} | ||
|
||
if $passenger::package_dependencies { | ||
package { $passenger::package_dependencies: | ||
if $passenger::options::package_dependencies { | ||
package { $passenger::options::package_dependencies: | ||
ensure => present, | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
class passenger::options { | ||
$passenger_version = $passenger::passenger_version | ||
$passenger_ruby = $passenger::passenger_ruby | ||
$passenger_package = $passenger::passenger_package | ||
$package_name = $passenger::package_name | ||
$package_provider = $passenger::package_provider | ||
|
||
if versioncmp ($passenger_version, '4.0.0') > 0 { | ||
$builddir = 'buildout' | ||
} else { | ||
$builddir = 'ext' | ||
} | ||
|
||
case $::osfamily { | ||
'debian': { | ||
$gem_path = '/var/lib/gems/1.8/gems' | ||
$gem_binary_path = '/var/lib/gems/1.8/bin' | ||
$passenger_root = "$gem_path/passenger-${passenger_version}" | ||
$mod_passenger_location = "$passenger_root/${builddir}/apache2/mod_passenger.so" | ||
|
||
# Ubuntu does not have libopenssl-ruby - it's packaged in libruby | ||
if $::lsbdistid == 'Debian' and $::lsbmajdistrelease <= 5 { | ||
$package_dependencies = [ 'libopenssl-ruby', 'libcurl4-openssl-dev' ] | ||
} else { | ||
$package_dependencies = [ 'libruby', 'libcurl4-openssl-dev' ] | ||
} | ||
} | ||
'redhat': { | ||
case $::lsbmajdistrelease { | ||
'5' : { $curl_package = 'curl-devel' } | ||
default : { $curl_package = 'libcurl-devel' } | ||
} | ||
case $::operatingsystemmajrelease { | ||
'6' : { | ||
$real_gem_path = "/usr/lib/ruby/gems/1.8/gems" | ||
$real_passenger_root = "${real_gem_path}/passenger-${passenger_version}" | ||
$real_mod_passenger_location = "${real_passenger_root}/${builddir}/apache2/mod_passenger.so" | ||
} | ||
'7' : { | ||
$real_gem_path = "/usr/local/share/gems/gems" | ||
$real_passenger_root = "${real_gem_path}/passenger-${passenger_version}" | ||
$real_mod_passenger_location = "$real_passenger_root/${builddir}/apache2/mod_passenger.so" | ||
} | ||
} | ||
$package_dependencies = [ $curl_package, 'openssl-devel', 'zlib-devel', 'gcc-c++', 'ruby-devel' ] | ||
$gem_path = $real_gem_path | ||
$gem_binary_path = '/usr/lib/ruby/gems/1.8/gems/bin' | ||
$passenger_root = $real_passenger_root | ||
$mod_passenger_location = $real_mod_passenger_location | ||
} | ||
'darwin':{ | ||
$gem_path = '/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin' | ||
$passenger_root = "$gem_path/passenger-${passenger_version}" | ||
$mod_passenger_location = "$passenger_root/${builddir}/apache2/mod_passenger.so" | ||
} | ||
default: { | ||
fail("Operating system ${::operatingsystem} is not supported with the Passenger module") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
LoadModule passenger_module <%= scope.lookupvar('passenger::mod_passenger_location') %> | ||
PassengerRoot <%= scope.lookupvar('passenger::passenger_root') %> | ||
PassengerRuby <%= scope.lookupvar('passenger::passenger_ruby') %> | ||
LoadModule passenger_module <%= @mod_passenger_location %> | ||
PassengerRoot <%= @passenger_root %> | ||
PassengerRuby <%= @passenger_ruby %> | ||
|
||
# you probably want to tune these settings | ||
PassengerHighPerformance on | ||
PassengerMaxPoolSize 12 | ||
PassengerPoolIdleTime 1500 | ||
# PassengerMaxRequests 1000 | ||
PassengerStatThrottleRate 120 | ||
<% if scope.lookupvar('passenger::passenger_version') =~ /^4\.\d+\.\d+/ -%> | ||
PassengerEnabled on | ||
<% else -%> | ||
<% if @passenger_version =~ /^3\.\d+\.\d+/ -%> | ||
RailsAutoDetect On | ||
<% else -%> | ||
PassengerEnabled on | ||
<% end -%> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant with the
creates
check in L7; if actually requiring a file (and not a symlink or directory) here is necessary, please remove thecreates