Skip to content

Instantly share code, notes, and snippets.

@alq666
Created March 12, 2013 16:41
Show Gist options
  • Save alq666/5144517 to your computer and use it in GitHub Desktop.
Save alq666/5144517 to your computer and use it in GitHub Desktop.
Allowing more generic monitor configuration
diff --git a/providers/ddmonitor.rb b/providers/ddmonitor.rb
index 1616a7a..70bee54 100644
--- a/providers/ddmonitor.rb
+++ b/providers/ddmonitor.rb
@@ -11,6 +11,7 @@ action :add do
owner "dd-agent"
mode 00400
notifies :restart, resources(:service => "datadog-agent")
+ variables :config => new_resource.config, :credentials => new_resource.credentials
end
end
diff --git a/resources/ddmonitor.rb b/resources/ddmonitor.rb
index 6e67d01..2ba8576 100644
--- a/resources/ddmonitor.rb
+++ b/resources/ddmonitor.rb
@@ -4,3 +4,5 @@ actions :add, :remove
default_action :add if defined?(default_action)
attribute :name, :kind_of => String, :name_attribute => true
+attribute :credentials, :kind_of => Hash, :required => false
+attribute :config, :kind_of => Hash, :required => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment