summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README15
-rwxr-xr-xfiles/munin/passenger_stats4
-rw-r--r--manifests/init.pp18
3 files changed, 27 insertions, 10 deletions
diff --git a/README b/README
index 7014d6f..549432e 100644
--- a/README
+++ b/README
@@ -8,9 +8,11 @@ Dependencies
------------
This module expects you to have:
- . munin module
. apache module
+Optional:
+ . munin module
+
Getting started
---------------
@@ -23,8 +25,15 @@ If you need to install a specific version of passenger or
librack-ruby, you can specify the version to be installed by providing
a variable, for example:
-$passenger_ensure_version = "2.2.3-2~bpo50+1"
-$librack-ruby_ensure_version = "1.0.0-2~bpo50+1"
+class { 'passenger':
+ passenger_ensure_version => '2.2.23-2~bpo50+1',
+ librack-ruby_ensure_version = "1.0.0-2~bpo50+1"
+}
+
+If you wish to use gems, pass 'use_gems => true'.
+
+By default munin will be used, but you can disable that by passing
+'use_munin => false'.
If you need to set different munin plugin configuration values, you
can also do so as follows:
diff --git a/files/munin/passenger_stats b/files/munin/passenger_stats
index a117903..f06e88a 100755
--- a/files/munin/passenger_stats
+++ b/files/munin/passenger_stats
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby
+PASSENGER_STATUS = ENV['passenger_status'] || '/usr/local/bin/passenger-status'
+
def output_config
puts <<-END
graph_category Passenger
@@ -16,7 +18,7 @@ END
end
def output_values
- status = `/usr/sbin/passenger-status`
+ status = `#{PASSENGER_STATUS}`
unless $?.success?
$stderr.puts "failed executing passenger-status"
exit 1
diff --git a/manifests/init.pp b/manifests/init.pp
index ffeeb7d..a5d5ea4 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -10,19 +10,25 @@
class passenger (
$use_gems = false, $use_munin = true,
$passenger_ensure_version = 'installed',
- $librack_ensure_version = 'installed' )
+ $librack_ensure_version = 'installed',
+ $passenger_bin_path = '/usr/sbin' )
{
+ include apache
if ! $use_gems {
apache::module { 'passenger':
ensure => $passenger_ensure_version,
package_name => 'libapache2-mod-passenger';
}
-
+
if !defined(Package["librack-ruby"]) {
- package {
- [ "librack-ruby", "librack-ruby1.8"] :
+ if $::lsbdistcodename == 'squeeze' {
+ package { 'librack-ruby1.8': ensure => $librack_ensure_version }
+ }
+ else {
+ package { 'ruby-rack':
ensure => $librack_ensure_version;
+ }
}
}
}
@@ -47,11 +53,11 @@ class passenger (
if $use_munin {
case $passenger_memory_munin_config { '':
- { $passenger_memory_munin_config = "user root\nenv.passenger_memory_stats /usr/sbin/passenger-memory-stats" }
+ { $passenger_memory_munin_config = "user root\nenv.passenger_memory_stats $passenger_bin_path/passenger-memory-stats" }
}
case $passenger_stats_munin_config { '':
- { $passenger_stats_munin_config = "user root\n" }
+ { $passenger_stats_munin_config = "user root\nenv.passenger_status $passenger_bin_path/passenger-status" }
}
munin::plugin::deploy {