From fc38664aa0c31d3d8bd559048e72ba5de6bf44f3 Mon Sep 17 00:00:00 2001 From: Scott Klein Date: Tue, 23 Apr 2013 17:43:44 +0000 Subject: [PATCH] Added template support for /etc/default/sensu --- manifests/init.pp | 10 ++++++---- manifests/package.pp | 12 ++++++++++++ templates/sensu.erb | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 templates/sensu.erb diff --git a/manifests/init.pp b/manifests/init.pp index 1ace2d7849..9511e05e24 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -32,6 +32,7 @@ $client_name = $::fqdn, $plugins = [], $purge_config = false, + $use_embedded_ruby = false, ){ Class['sensu::package'] -> @@ -61,10 +62,11 @@ } class { 'sensu::package': - version => $version, - install_repo => $install_repo, - notify_services => $notify_services, - purge_config => $purge_config, + version => $version, + install_repo => $install_repo, + notify_services => $notify_services, + purge_config => $purge_config, + use_embedded_ruby => $use_embedded_ruby, } class { 'sensu::rabbitmq': diff --git a/manifests/package.pp b/manifests/package.pp index ad46fe32b0..13ede62af7 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -10,6 +10,7 @@ $notify_services = [], $install_repo = 'true', $purge_config = 'false', + $use_embedded_ruby = 'true', ) { if $install_repo == 'true' or $install_repo == true { @@ -29,6 +30,17 @@ } } + file { 'sensu': + ensure => file, + path => '/etc/default/sensu', + content => template("${module_name}/sensu.erb"), + owner => '0', + group => '0', + mode => '0644', + require => Package['sensu'], + notify => $notify_services, + } + file { ['/etc/sensu/plugins', '/etc/sensu/handlers']: ensure => directory, mode => '0555', diff --git a/templates/sensu.erb b/templates/sensu.erb new file mode 100644 index 0000000000..abc06bb614 --- /dev/null +++ b/templates/sensu.erb @@ -0,0 +1,2 @@ +EMBEDDED_RUBY=<%= use_embedded_ruby %> +