forked from blt04/puppet-rvm
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue #15] Use puppetlabs/apache module to configure Passenger
[Issue #13] Ensure passenger is not installed on each run
- Loading branch information
Carlos Sanchez
committed
Nov 6, 2013
1 parent
c75c4dc
commit e92fe9a
Showing
10 changed files
with
71 additions
and
191 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name 'maestrodev-rvm' | ||
version '1.1.13' | ||
version '1.2.0' | ||
|
||
summary 'A puppet module for installing and using RVM (Ruby Version Manager)' | ||
author 'maestrodev & Brandon Turner <[email protected]>' | ||
|
@@ -9,3 +9,4 @@ source 'http://github.com/maestrodev/puppet-rvm' | |
description 'Installing and using RVM (Ruby Version Manager)' | ||
|
||
dependency 'puppetlabs/stdlib', '>=3.2.0' | ||
dependency 'puppetlabs/apache', '>=0.9.0' |
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,3 +1,4 @@ | ||
forge 'http://forge.puppetlabs.com' | ||
|
||
mod 'puppetlabs/stdlib', '>=3.2.0' | ||
mod 'puppetlabs/apache', '>=0.9.0' |
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,8 +1,13 @@ | ||
FORGE | ||
remote: http://forge.puppetlabs.com | ||
specs: | ||
puppetlabs/apache (0.9.0) | ||
puppetlabs/concat (>= 1.0.0) | ||
puppetlabs/stdlib (>= 2.4.0) | ||
puppetlabs/concat (1.0.0) | ||
puppetlabs/stdlib (4.1.0) | ||
|
||
DEPENDENCIES | ||
puppetlabs/apache (>= 0.9.0) | ||
puppetlabs/stdlib (>= 3.2.0) | ||
|
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,77 +1,43 @@ | ||
class rvm::passenger::apache( | ||
$ruby_version, | ||
$version, | ||
$rvm_prefix = '/usr/local/', | ||
$rvm_prefix = '/usr/local', | ||
$mininstances = '1', | ||
$maxpoolsize = '6', | ||
$poolidletime = '300', | ||
$maxinstancesperapp = '0', | ||
$spawnmethod = 'smart-lv2' | ||
) { | ||
|
||
if ( versioncmp( $rvm::passenger::apache::version, '4.0.0' ) < 0 ) { | ||
if ( versioncmp( $rvm::passenger::apache::version, '3.9.0' ) < 0 ) { | ||
$objdir = 'ext' | ||
} | ||
else { | ||
$objdir = 'libout' | ||
} | ||
} | ||
else { | ||
$objdir = 'buildout' | ||
} | ||
|
||
case $::osfamily { | ||
Debian: { include rvm::passenger::apache::ubuntu::pre } | ||
RedHat: { include rvm::passenger::apache::centos::pre } | ||
} | ||
|
||
class { | ||
'rvm::passenger::gem': | ||
ruby_version => $ruby_version, | ||
version => $version, | ||
class { 'rvm::passenger::gem': | ||
ruby_version => $ruby_version, | ||
version => $version, | ||
} | ||
|
||
# TODO: How can we get the gempath automatically using the ruby version | ||
# Can we read the output of a command into a variable? | ||
# e.g. $gempath = `usr/local/rvm/bin/rvm ${ruby_version} exec rvm gemdir` | ||
$gempath = "${rvm_prefix}rvm/gems/${ruby_version}/gems" | ||
$binpath = "${rvm_prefix}rvm/bin/" | ||
$gempath = "${rvm_prefix}/rvm/gems/${ruby_version}/gems" | ||
$binpath = "${rvm_prefix}/rvm/bin/" | ||
$gemroot = "${gempath}/passenger-${version}" | ||
|
||
# build the Apache module | ||
# different passenger versions put the built module in different places (ext, libout, buildout) | ||
include apache::dev | ||
exec { 'passenger-install-apache2-module': | ||
command => "${rvm::passenger::apache::binpath}rvm ${rvm::passenger::apache::ruby_version} exec passenger-install-apache2-module -a", | ||
unless => "test -f ${gemroot}/ext/apache2/mod_passenger.so || test -f ${gemroot}/libout/apache2/mod_passenger.so || test -f ${gemroot}/buildout/apache2/mod_passenger.so", | ||
environment => [ 'HOME=/root', ], | ||
path => '/usr/bin:/usr/sbin:/bin', | ||
require => Class['rvm::passenger::gem','apache::dev'], | ||
} | ||
|
||
case $::operatingsystem { | ||
Ubuntu,Debian: { | ||
if !defined(Class['rvm::passenger::apache::ubuntu::post']) { | ||
class { 'rvm::passenger::apache::ubuntu::post': | ||
ruby_version => $ruby_version, | ||
version => $version, | ||
rvm_prefix => $rvm_prefix, | ||
objdir => $objdir, | ||
mininstances => $mininstances, | ||
maxpoolsize => $maxpoolsize, | ||
poolidletime => $poolidletime, | ||
maxinstancesperapp => $maxinstancesperapp, | ||
spawnmethod => $spawnmethod, | ||
gempath => $gempath, | ||
binpath => $binpath; | ||
} | ||
} | ||
} | ||
CentOS,RedHat,Scientific: { | ||
if !defined(Class['rvm::passenger::apache::centos::post']) { | ||
class { 'rvm::passenger::apache::centos::post': | ||
ruby_version => $ruby_version, | ||
version => $version, | ||
rvm_prefix => $rvm_prefix, | ||
objdir => $objdir, | ||
mininstances => $mininstances, | ||
maxpoolsize => $maxpoolsize, | ||
poolidletime => $poolidletime, | ||
maxinstancesperapp => $maxinstancesperapp, | ||
spawnmethod => $spawnmethod, | ||
gempath => $gempath, | ||
binpath => $binpath; | ||
} | ||
} | ||
} | ||
class { 'apache::mod::passenger': | ||
passenger_root => $gemroot, | ||
passenger_ruby => "${rvm_prefix}/rvm/wrappers/${ruby_version}/ruby", | ||
passenger_max_pool_size => $maxpoolsize, | ||
passenger_pool_idle_time => $poolidletime, | ||
require => Exec['passenger-install-apache2-module'], | ||
subscribe => Exec['passenger-install-apache2-module'], | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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