From e4041f5e7fd76b28d4c6a51f10ea878c2f047006 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Fri, 1 Mar 2013 15:52:31 +0100 Subject: [PATCH] Added standalone property --- lib/puppet/provider/sensu_check_config/json.rb | 8 ++++++++ lib/puppet/type/sensu_check_config.rb | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/puppet/provider/sensu_check_config/json.rb b/lib/puppet/provider/sensu_check_config/json.rb index e0bbaead42..3da566dd91 100644 --- a/lib/puppet/provider/sensu_check_config/json.rb +++ b/lib/puppet/provider/sensu_check_config/json.rb @@ -120,4 +120,12 @@ def high_flap_threshold def high_flap_threshold=(value) conf['checks'][resource[:realname]]['high_flap_threshold'] = value end + + def standalone + conf['checks'][resource[:realname]]['standalone'] + end + + def standalone=(value) + conf['checks'][resource[:realname]]['standalone'] = value + end end diff --git a/lib/puppet/type/sensu_check_config.rb b/lib/puppet/type/sensu_check_config.rb index 57c9a3a0e9..711df6feb2 100644 --- a/lib/puppet/type/sensu_check_config.rb +++ b/lib/puppet/type/sensu_check_config.rb @@ -65,11 +65,19 @@ def initialize(*args) newproperty(:subscribers, :array_matching => :all) do desc "Who is subscribed to this check" end - + newproperty(:type) do desc "What type of check is this" end + newproperty(:standalone, :boolean => true) do + desc "Whether this is a standalone check" + + newvalues(:true, :false) + + defaultto :false + end + autorequire(:package) do ['sensu'] end