From a5b6a893b494033eec5c4bec9a8aa89bf65a9571 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 7 May 2010 10:41:47 -0400 Subject: allow for munin plugin configuration overrides, update README to reflect this and remove redundant README info from comments --- README | 9 +++++++++ manifests/init.pp | 28 +++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/README b/README index c3e40b0..7f39265 100644 --- a/README +++ b/README @@ -16,9 +16,18 @@ Getting started Simply do 'include passenger' and it will be installed. +Configuration +------------- + 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" + +If you need to set different munin plugin configuration values, you +can also do so as follows: + +$passenger_memory_munin_config = "user root\nenv.passenger_memory_stats /opt/bin/passenger-memory-stats" +$passenger_stats_munin_config = "user root\nenv.PASSENGER_TMPDIR=/var/tmp\n" diff --git a/manifests/init.pp b/manifests/init.pp index a5f3fcc..3078cfe 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -6,16 +6,19 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. -# -# 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_ensure_version = "1.0.0-2~bpo50+1" class passenger { + $real_passenger_memory_munin_config = $passenger_memory_munin_config ? { + '' => "user root\nenv.passenger_memory_stats /usr/sbin/passenger-memory-stats", + default => $passenger_memory_munin_config, + } + + $real_passenger_stats_munin_config = $passenger_stats_munin_config ? { + '' => "user root", + default => $passenger_stats_munin_config, + } + if !defined(Package["libapache2-mod-passenger"]) { if $passenger_ensure_version == '' { $passenger_ensure_version = 'installed' } package { @@ -38,9 +41,16 @@ class passenger { munin::plugin::deploy { 'passenger_memory_stats': source => "passenger/munin/passenger_memory_stats", - config => "user root\nenv.passenger_memory_stats /usr/sbin/passenger-memory-stats"; + config => $real_passenger_memory_munin_config; 'passenger_stats': source => "passenger/munin/passenger_stats", - config => "user root"; + config => $real_passenger_stats_munin_config; + } +} + +test::deploy { + 'passenger_memory_stats': + source => "test/deploythis", + config => $passenger_munin_config } } -- cgit v1.2.3