Permalink
Browse files

Merge in Forge Module

Merge in the current module that exists on the Forge.
  • Loading branch information...
1 parent a1ae60f commit 681a2043206f5d305d141603b611c1f2f9357250 @glarizza glarizza committed Jun 20, 2011
Showing with 77 additions and 0 deletions.
  1. +5 −0 Modulefile
  2. +38 −0 manifests/init.pp
  3. +33 −0 manifests/params.pp
  4. +1 −0 tests/init.pp
View
5 Modulefile
@@ -0,0 +1,5 @@
+name 'puppetlabs-passenger'
+version '0.0.2'
+dependency 'puppetlabs-apache', '0.0.3'
+dependency 'puppetlabs-gcc', '0.0.1'
+dependency 'puppetlabs-ruby', '0.0.1'
View
38 manifests/init.pp
@@ -0,0 +1,38 @@
+# Class: passenger
+#
+# This class installs passenger
+#
+# Parameters:
+#
+# Actions:
+# - Install passenger gem
+# - Compile passenger module
+#
+# Requires:
+# - ruby::dev
+# - gcc
+# - apache::dev
+#
+# Sample Usage:
+#
+class passenger {
+ include passenger::params
+ require ruby::dev
+ require gcc
+ require apache::dev
+ $version=$passenger::params::version
+
+ package {'passenger':
+ name => 'passenger',
+ ensure => $version,
+ provider => 'gem',
+ }
+
+ exec {'compile-passenger':
+ path => [ $passenger::params::gem_binary_path, '/usr/bin', '/bin'],
+ command => 'passenger-install-apache2-module -a',
+ logoutput => true,
+ creates => $passenger::params::mod_passenger_location,
+ require => Package['passenger'],
+ }
+}
View
33 manifests/params.pp
@@ -0,0 +1,33 @@
+# Class: passenger::params
+#
+# This class manages parameters for the Passenger module
+#
+# Parameters:
+#
+# Actions:
+#
+# Requires:
+#
+# Sample Usage:
+#
+class passenger::params {
+ $version='2.2.11'
+
+ case $operatingsystem {
+ 'ubuntu', 'debian': {
+ $gem_path = '/var/lib/gems/1.8/gems/'
+ $gem_binary_path = '/var/lib/gems/1.8/bin'
+ $mod_passenger_location = "/var/lib/gems/1.8/gems/passenger-$version/ext/apache2/mod_passenger.so"
+ }
+ 'centos', 'fedora', 'redhat': {
+ $gem_path = '/usr/lib/ruby/gems/1.8/gems'
+ $gem_binary_path = '/usr/lib/ruby/gems/1.8/gems/bin'
+ $mod_passenger_location = "/usr/lib/ruby/gems/1.8/gems/passenger-$version/ext/apache2/mod_passenger.so"
+ }
+ 'darwin':{
+ $gem_path = '/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin'
+ $gem_binary_path = '/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin'
+ $mod_passenger_location = "/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/passenger-$version/ext/apache2/mod_passenger.so"
+ }
+ }
+}
View
1 tests/init.pp
@@ -0,0 +1 @@
+include passenger

0 comments on commit 681a204

Please sign in to comment.